DEV Community

Toolloom
Toolloom

Posted on • Originally published at toolloom.com on

Did You Forget a File? Use Git Amend!

We’ve all done it: you commit your feature, hit push, and then realize you forgot to stage that one crucial configuration file or fix a tiny typo. Instead of creating a messy 'Fixing typo' commit right afterward, use git commit --amend. First, stage the missing file (git add missing_file.js), then run the amend command. This merges your new staged changes into the *previous* commit, keeping your history clean and tidy. Just remember not to amend commits you've already pushed to a shared remote branch!

Top comments (0)