How to remove staged changes from git

· Origin Unknown · 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

Want to Contribute?

Send me an Email, ping me on Twitter or submit a pull request on Github.

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