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.