git commit --amend --reset-author

Category: Git - Advanced

git commit --amend --reset-author

Rewrite the last commit with your identity

Amends the most recent commit and resets its author to your configured identity, fixing commits made with the wrong name or email. Handy after realizing you committed with a work account. Amending changes the hash, so avoid it on pushed commits.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.