Skip to main content

amend

Amend

Amend allows you to modify the most recent commit.

Modify the Last Commit Message

git commit --amend

This opens an editor with the previous commit message.

Add Changes to the Last Commit:

If you made additional changes after the commit and want to include them in the previous commit.

git add <file>
git commit --amend

This will update the last commit with the new changes.

Note: Amending commits rewrites history. Never use this as it could create issues for others working with the same branch.