Dude, I suggest you read the Git tutorial provided itself here.
But basically, you will do the command git rebase -i HEAD~2
in the same way that you are currently doing, indicating that you wish to perform an iterative rebase. After that, a message containing the commits and some options will be shown, among them the option r, reword
which corresponds to using the same commit but rewriting your message.
You will then enter edit mode on the terminal and replace pick
that precedes the commit hash by r
. After that, you exit edit mode, save and continue. Then the commits that you want to change the message will be shown, you change the messages by entering the edit mode, and after changing, saving and continuing. Finally you perform the command git commit --amend
. Ready, you changed the commit messages.