Hi! I'm Nathan Hoad


How to: Undo git commit

If you ever need to undo a commit a commit it's as simple as:

git reset HEAD~

Or, if you feel like setting up an alias:

git config --global alias.undo 'git reset HEAD~'

Then you can just type git undo and it will revert your last commit.

If I just made your day a little better then thank me with a coffee or maybe a a pizza