git amend old commit message code example
Example 1: change message from last pushed commit
git commit --amend
Example 2: how to edit old commit message in git
# Displays a list of the last 3 commits on the current branch
$ git rebase -i HEAD~3
git commit --amend
# Displays a list of the last 3 commits on the current branch
$ git rebase -i HEAD~3