How to undo ‘git add’ before commit?
If you have accidentally added files to the staging area using git add and want to undo it before committing, you can use the git restore or git reset command. Here’s how to do it, with examples: Undo git add for a Specific File If you want to unstage a specific file: git restore --staged […]