How to remove staged changes from git?

Written on by Mandeep Singh in Solving Mistories

To remove your stagged changes or to undo your last git add command you can simply use git reset. Running the below command will simply remove all files from your staging area:

git reset

In case you want to remove only a specifc file(s) than you can mention the name of file(s), like this:

# To remove a single file
git reset filename.ext

# You can also remove bunch of files using simple rejex expressions
git reset content/*.png

Sign up below to receive updates, tips and more handy tutorials. It’s good stuff & I don’t spam.