how to revert using git code example Example 1: revert commit git $ git revert HEAD Example 2: how to revert commit in git git checkout <commit hash>