Lets say you made a typo in a commit
$ git commit -am 'Fx the bugz'
Oh noes! You made a typo.
$ git commit --amend
This will open your commit editor. You can simply reword the message and you're done.
But what if you only noticed the bad message after you've made several commits?
Firstly, find out how far back the commit was:
$ git log
Lets say it was 3 commits ago.
$ git rebase HEAD~3 -i
You can now see the last 3 commits.
Find the commit with the bad commit message and change
You can now edit the message with your editor and git will update the commits.
Note: This rewrites history, so if you've previously pushed to a remote with this branch you'll need to
--force push the new commits.