git status
git branchThis tactic will make our branch, branch from the new head of the other branch effectively changing the commit history.
git checkout <feature-branch>
git rebase <branch-to-synch-to>
git rebase <branch-to-synch-to> --interactive # to also squash commitThis tactic will effectively merge the changes from the other branch into our current working directory creating new merge commits to add the changes.
git fetch
git merge origin/maingit pull origin <current-branch>git add .
git commit -m "implemented new feature"
git push origin <branch-your-at>Provide the id of the commit itself that you want to revert
git revert <commit-ID> -m "reverting last commit"Provide the id of the commit that you want to reset back to
git reset (commit-ID) # keep the committed changes
git reset (commit-ID) --hard # discard the committed changes (more dangerous)git merge --abort