git commit --amend -m "The message you meant to write"
Leave off -m and your editor opens with the old message to edit. If you also staged new changes, they get folded into the commit, which is handy or surprising depending on what you wanted.
Amending rewrites the commit, so only do it before you push. If it's already on the remote and you're on your own branch, git push --force-with-lease is the safe-ish way to push it.