Undo Git Commit

Back to snippets

To undo a recent local commit, run the following:

git reset HEAD~

Avoid undoing local commits if they have been pushed.