On Fri, 12 Feb 2016 11:01:40 -0500
wor...@alum.mit.edu (Dale R. Worley) wrote:

> Suppose I've modified a file, or a set of files, and I want to return
> it to the state in HEAD.  I thought that "git checkout HEAD file1
> file2 ..." would do that, but git-checkout wants to preserve whatever
> changes are present in the file tree.  I'm sure that buried in Git's
> UI is a command form that will do this easily, and I probably knew it
> once, but I've forgotten.

I'd say there are only one reason for the

  it checkout HEAD file1 file2 ...

invocation to fail file1 starts with a dash or double dash and gets
interpreted as a command-line option.

To fix this, place "--" between the commitish and the name
of the first file.

Are you sure you aren't trying to call `git checkout HEAD` instead?

By the way, if you're OK with reverting the state of the index
as well as the work tree,

  git reset --hard

would do just OK.

You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to