News for hackers. Stuff that matters.
Re:Simple Revision Control by kazinator on Friday November 14, 2014 @11:47AM (#8608053)
"git checkout -- <file>" does not actually revert a file from the branch. It reverts it from the index. It's only a revert-to-branch operation if you don't have anything in the index. So if you land into one of those "gituations" where use of the index is being foisted upon you, it might not do what you are used to.

There is also the flaw that the -- separator is not required for giving paths: "git checkout <file>" also works. So if you are trying to check out a branch or tag, and make a typo and accidentally type the name of a file which has unstaged changes, you lose them. It doesn't rename the original file to a backup like good old "cvs up -C file".

Re:Simple Revision Control by digisign on Sunday November 16, 2014 @03:21PM (#8615289)
IC. I added the " -- " syntax because that's what it recommends when doing a "git status".