The commit goes away, the changes stay staged:
git reset --soft HEAD~1
If you want them unstaged as well, leave out --soft (the default is --mixed):
git reset HEAD~1
And --hard throws the changes away too, so think twice before you type that one. Everything is still in git reflog for a while if you did.
Only do any of this on commits you haven't pushed yet. For a pushed commit, git revert HEAD creates a new commit that undoes it, which is the polite way.