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?
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?
git reset -- FILE_NAME
will do it.
This means that
git reset <pathspec>
is the opposite ofgit add <pathspec>
you could use
git reset --mixed -- <filename>
if you use --hard, you would discard all your changes.