Inside the magit log history, I can see the list of commits. How do I roll back to a specific commit from the list?

I can move to that commit and use d to see the diff/change of that commit, but I do not know how to check it out.

  • You probably want to read about the git reset command (and especially the difference between a hard and a soft reset). Magit binds x to a soft reset, and C-u x to a hard reset.
    – phils
    Dec 7, 2015 at 6:16

1 Answer 1


I like to do this with bb. You'll be prompted for a branch with completion, and the current element (e.g. navigate to it with ll) will be the default. Then simply press RET to check out that commit. It's also possible to paste a commit hash during the bb input.

  • 1
    Bearing in mind that while the title says "checkout", the question text actually says "rollback".
    – phils
    Dec 7, 2015 at 22:45
  • That's useful to tag previous commits too, which goes to HEAD.
    – Muihlinn
    Mar 11 at 8:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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