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

I've used Mercurial for some time now, and am used to its workflow. Suddenly, I need to work with a Git repository, and I cannot make the install work from the head revision. In Mercurial I would just update to an earlier revision and go, but I don't see how to do that in Git.

So, how do I revert to an earlier state in a Git repository?

share|improve this question
up vote 8 down vote accepted
git checkout <older revision key>

The first little bit of the hash works as a revision key, provided that it only matches that revision.

share|improve this answer
Perfect, thanks! – dimo414 Sep 27 '10 at 18:07

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.