Last updated 8 months ago
We can use git commit --amend command to change the most recent commit message.
git commit --amend
$ git commit --amend -m "{NEW_MESSAGE}
In this case, we can only edit the most recent commit message and force push it to remote -
$ git commit --amend -m "{NEW_MESSAGE}" $ git push --force
Note: Force Pushes can break things, so warnings ahead!
Source: