How to undo a Git commit First, decide how far back to go into the version history. ... Once the IT team chooses a code version to which their tree should revert, use the commit ID to execute the command. ... git reset x12345. git reset head~1. Admins can also use git revert. Mar 25, 2021