In the branch containing the commits to rename (3 is to go back to third commit):
- git rebase -i HEAD~3
- replace pick by reword for the lines that will have to be renamed (without changing the message yet) and save the file
- edit the message each time it is requested (for the commits for which pick was replaced by reword)
- git push origin branch_name -f