If you only want to modify your last commit message, then do:
git commit --amend
That will drop you into your text editor and let you change the last commit message.
If you want to change the last three commit messages, or any of the commit messages up to that point, supply HEAD~3
to the git rebase -i
command:
git rebase -i HEAD~3