How to use git

Checkout and push local changes

Follow the steps bellow to push your changes from local development


git checkout origin develop

git checkout -b new-feature-branch

  git status

 git add --all

    git commit -m "message of the commit"

git checkout develop

git pull origin develop

git checkout new-feature-branch

git merge develop

git push origin new-feature-branch

     git branch -d new-feature-branch

        git push origin --delete new-feature-branch |or| git push origin :new-feature-branch

  git stash

          git stash list 

          git stash apply


Roll back local and remote git commits

If you want revert last commit listen:

Step 1:

Check your local commits with messages

git log


Step 2:

Remove last commit without resetting the changes from local branch (or master)

 git reset HEAD^


OR if you don't want last commit files and updates listens

git reset HEAD^ --hard


Step 3:

We can update the files and codes and again need to push with force it will delete previous commit. It will keep new commit.

git push origin branch -f