Reputation: 38832
After I made changes on a file. I use git add FILE_NAME
.
Then, I would like to revert it as not added but meanwhile keep the changes, how to do this?
Upvotes: 21
Views: 18844
Reputation: 27834
git reset -- FILE_NAME
will do it.
This means that
git reset <pathspec>
is the opposite ofgit add <pathspec>
Upvotes: 41
Reputation: 26968
you could use
git reset --mixed -- <filename>
if you use --hard, you would discard all your changes.
Upvotes: 2