Daily Software Tips & Tricks
Bite-sized knowledge to improve your coding skills daily.
Did You Forget a File? The Git Amend Lifesaver
February 9, 2026
We’ve all been there: you commit your changes, only to realize you forgot to stage one crucial file or you made a typo in the commit message. Before you create a messy 'Fixing typo' commit, use the power of `git commit --amend`. First, stage the forgotten file (`git add <file>`), then run the amend command. This command rewrites the *last* commit, incorporating your new changes or allowing you to edit the message, keeping your repository history clean and tidy before pushing upstream.