revert git command code example Example 1: revert commit git git revert <commit hash> Example 2: revert commit git $ git revert HEAD