1 - Undo commit and keep all files staged:

 git reset --soft HEAD~ 

2 - Undo commit and unstage all files:

 git reset HEAD~ 

3 - Undo the commit and completely remove all changes:

 git reset --hard HEAD~