git command to revert back the commit code example Example 1: revert git commit git revert <the_commit_hash> Example 2: revert commit git $ git revert HEAD