How to undo a modified file on Git? If I do a git status
I get the message: modified: project/index.html
however I want to undo all changes on that file before adding to stage.
Asked
Active
Viewed 246 times
1

brunodd
- 2,474
- 10
- 43
- 66
-
1The `git status` output message already tells you how to do it: `Changes not staged for commit: (use "git add
..." to update what will be committed) (use "git checkout -- – Antonio Pérez Nov 25 '15 at 14:21..." to discard changes in working directory)` -
If you undo the changes then there will be nothing to stage. – axiac Nov 25 '15 at 14:26
1 Answers
3
Do git checkout of that file
git checkout project/index.html

rajuGT
- 6,224
- 2
- 26
- 44
-
2To see more about that `git checkout -- file`, see http://stackoverflow.com/a/33849726/6309. – VonC Nov 25 '15 at 14:37