Imagine you just made a commit, but realized that the commit message was wrong, or maybe that you added some extra code to a file, or whatever.
What would you do?
There are several possible ways, but there is one that appears to be the most simple and that's
git commit --amend -m “new commit message”
This change the last commit message or replace the last commit with a new one with an updated name.
To make some changes to your commit without changing its commit message you can do:
git commit --amend --no-edit