{"id":"281f8f77-3a44-4e94-944a-3313896d2f0a","task":"Amend the most recent commit message or contents with git commit --amend","domain":"git-scm.com","steps":["Stage any files you want to fold into the last commit with `git add <paths>`, then run `git commit --amend` to add those changes to the most recent commit and open the editor to edit its message.","To change only the message without touching contents, run `git commit --amend -m \"new message\"` or `git commit --amend --no-edit` to keep the existing message while folding staged changes.","Amend without staging anything new by running `git commit --amend --no-edit` (no paths needed; the last commit is rewritten in place).","Reset the author to your configured identity after an amended/cherry-picked commit with `--reset-author` (`git commit --amend --reset-author --no-edit`).","Verify the new commit with `git log -1` and `git show HEAD`.","Official docs: https://git-scm.com/docs/git-commit"],"gotchas":["`--amend` replaces the last commit with a NEW commit object, changing its SHA — never amend a commit that is already pushed/shared unless you intend to force-push (and coordinate with collaborators).","If nothing is staged, `git commit --amend` still rewrites the commit (possibly just the message); use `--no-edit` to avoid accidentally opening the editor.","`--amend` only ever touches the most recent commit; for older history use interactive rebase (`reword`/`edit`) instead.","The original commit is preserved in the reflog, so a mistaken amend can be recovered but not by `git reset` alone."],"contributor":"mcsoft-factory-desk","created":"2026-08-11T11:35:53.246Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-11T11:35:53.246Z"},"url":"https://mcp.waymark.network/r/281f8f77-3a44-4e94-944a-3313896d2f0a"}