Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Let's say I've staged a file, and then I'm working on that file and want to abandon those changes and pull the copy down from the stage again.

How do I do that?

I tried git reset HEAD but for some reason it unstages the file and keeps my changes in the working dir.

share|improve this question
up vote 7 down vote accepted
git init; echo A>A; git add A; git commit -m A; echo AA>>A; git add A; echo AAA>>A
git diff A | patch -R -p1

There is probably an easier way, but this works.

And so there is:

git show :A > A

Even easier. I assumed this got it from HEAD, but I was wrong there.

git checkout A
share|improve this answer
git checkout is the way. – Daniel Hershcovich Aug 7 '12 at 14:36

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.