Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GIT add revert in my case (keep changes)

Tags:

git

github

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?

like image 757
Mellon Avatar asked Dec 05 '11 16:12

Mellon


2 Answers

git reset -- FILE_NAME will do it.

See the git reset manual:

This means that git reset <pathspec> is the opposite of git add <pathspec>

like image 193
Christoffer Hammarström Avatar answered Sep 21 '22 12:09

Christoffer Hammarström


git stash save 
git stash apply 

they will all be unstaged

like image 30
eomeroff Avatar answered Sep 19 '22 12:09

eomeroff