Created
April 12, 2012 12:11
-
-
Save dantunes/2366856 to your computer and use it in GitHub Desktop.
Undo a git add - remove files staged for a git commit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Unstage a single file from the "about to be commited" | |
git reset filename.txt | |
#Unstage a "git add ." | |
git reset |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You what? The default if you don't specify anything is a --mixed reset so it's impossible to follow the above snippet and LOSE your changes, since it doesn't use --hard. You made me panic and look through my command line multiple times to check if I lost anything (which I didn't).