Amending the last commit

Changing the message or the contents of the commit you have just made, with a preview first.

Amending replaces your most recent commit with a new one. Use it for the commit you made thirty seconds ago and immediately regretted: a typo in the message, a file you meant to include, a change you meant to leave out.

The amend button is under the commit message field, between the signing toggle and Commit. It opens a review where you can edit the message and inspect the files before anything is rewritten.

Edit the message and review the staged files before replacing the last commit.

What it changes

Whatever is staged when you amend joins the commit. To change only the message, leave nothing staged.

The review starts with your Working Copy message if you have written one, or the existing commit message otherwise. Edit it there; Show Original reveals the old message for comparison once the text differs. The message must not be empty.

Staged Changes to Include lists what will join the commit. Expand Original commit to inspect the files already in it. Open Diff… opens either set in the Diff Review window.

Choose Amend Commit to replace the commit. Cancelling leaves the Working Copy draft and staged changes as they were. With an unchanged message, nothing staged and signing off, there is nothing to amend and confirmation stays disabled.

The signing toggle applies here as it does to a normal commit — see committing.

If you need to go further back

Amend only reaches the last commit. For anything older, or for taking a commit apart rather than adjusting it, see undo my last commit and the safety net.