Fix the most recent local commit
git commit --amend replaces the latest commit with a new commit. It is useful for correcting a message or adding a forgotten file before the commit is shared.
Amend changes the commit identity
The amended commit has a new hash because its content or metadata changed. This is normally harmless for a commit that exists only in your local branch.
Do not casually amend shared history
If other developers already based work on the old commit, amending it creates a history mismatch. Coordinate before rewriting commits that others may have pulled.