1

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.

brunodd
  • 2,474
  • 10
  • 43
  • 66
  • 1
    The `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 -- ..." to discard changes in working directory)` – Antonio Pérez Nov 25 '15 at 14:21
  • If you undo the changes then there will be nothing to stage. – axiac Nov 25 '15 at 14:26

1 Answers1

3

Do git checkout of that file

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