git rollback last commit to a new branch code example Example: how to revert branch to old commit git revert --no-commit 0766c053..HEAD git commit