Case 1: If all you are looking for is to undo the act of committing, leaving everything else intact, use:
$ git reset --soft HEAD^
Case 2: In case you want to undo the act of committing and everything you'd staged, but leave the work tree (your files intact):
$ git reset HEAD^
Case 3: But if you want to completely undo it, throwing away all uncommitted changes, resetting everything to the previous commit:
$ git reset --hard HEAD^