restore branch on commit code example Example: how to reset git branch to a certain commit. git revert --no-commit 0766c053..HEAD git commit