Compare

git commit --amend vs new commit

When to revise the last commit and when to add another commit instead.

Amend rewrites the most recent commit. A new commit preserves the previous one and adds another step to history. The main question is whether history rewriting is still safe.

Use Amend When

You just made the last commit and want to fix a message or include a forgotten file.

The commit has not been shared yet and rewriting it will not surprise anyone else.

Use a New Commit When

The original commit is already pushed or part of shared history.

You want an explicit follow-up change rather than hiding the correction inside the previous commit.

Rule of Thumb

Amend before sharing. Add a new commit after sharing.

Want the short version? Browse the compact sheet views and save the commands you use most into a Cheatbook.