go back commit of another branch code example Example: move a branch back in git git checkout A git reset --hard B git push --force github