How to remove files staged for commit from git add

If you accidentally add files to a commit, it’s easy to remove them through the cli.

To remove one file:

git reset imageidontwant.jpg


To reset all added files.  (You’ll have to re-add the files you actually want to add to the commit.)  Simply type

git reset


That will unstage any files.  It will not undo commits.  That’s a more complicated process.


Leave a Reply

Your email address will not be published. Required fields are marked *