How to amend git commit messages

  • Start an interactive rebase
git rebase -i HEAD~<relative position of the commit from HEAD>
  • Tell git to start rewording commit msg
pick <some commit message I want to change>
pick ...
reword <some commit message I want to change>
pick ...
  • Git should open up your editor permitting you to change the message
<reword message>

Reference: https://linuxize.com/post/change-git-commit-message/