Daily Software Tips & Tricks

Bite-sized knowledge to improve your coding skills daily.

The Power of Amending Your Last Commit

February 3, 2026

We all forget to stage that one critical file, or maybe you spot a typo in your commit message immediately after committing. Instead of creating a messy 'Fix typo' commit right after your main feature commit, try `git commit --amend`. Stage the missing files (`git add missing_file`), and then run the amend command. This rewrites your previous commit, keeping your history clean and professional—just remember not to amend commits you’ve already pushed to shared branches.