When under git you modify some files, using git status
, comes out the following message:
On branch dev
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: script.php
So I usually used git checkout -- script.php
to undo my edits, as suggested.
I found anyway, from a collegue, that git checkout script.php
seems to accomplish the same result.
So, my question is: are git checkout -- script.php
and git checkout script.php
synonyms, or not?
Please, provide at least a link to some documentation that proves what you said. Thanks!