commit in git to previuos commit code example Example: revert git commit git revert <the_commit_hash>