1

I would like to reset my working directory to the state in another commit. In pure git, I'd use git checkout <commit> -- <file>. Is there a way to reach similar functionality from any of the dispatch popups in magit?

1

1 Answer 1

1

Use M-x magit-checkout-file RET <rev> RET <file RET.

4
  • Is there a pre-defined keyboard shortcut for it in one of the dispatch popups?
    – Nikratio
    Commented Oct 3, 2016 at 4:26
  • No. What is your use-case?
    – tarsius
    Commented Oct 3, 2016 at 10:19
  • Well, what is magit's use case? Using Git from emacs without having to type out the git command (or, in this case, an even longer emacs command).
    – Nikratio
    Commented Oct 4, 2016 at 2:21
  • None. That's why no key is bound to the command. The command exists because someone asked the same question some other time I assume. You can of course bind some key to it. Personally I almost never use it and when then I use the equivalent git command. But if I knew a compelling use then I might be able to think of a suitable key binding. That's why I asked.
    – tarsius
    Commented Oct 4, 2016 at 8:33

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.