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?
Asked
Active
Viewed 275 times
1

Nikratio
- 919
- 1
- 6
- 11
-
1Does this answer your question? [How do I checkout a file from another commit in Magit](https://emacs.stackexchange.com/questions/14463/how-do-i-checkout-a-file-from-another-commit-in-magit) – phils Jun 23 '21 at 05:12
1 Answers
1
Use M-x magit-checkout-file RET <rev> RET <file RET
.

tarsius
- 25,298
- 4
- 69
- 109
-
Is there a pre-defined keyboard shortcut for it in one of the dispatch popups? – Nikratio Oct 03 '16 at 04:26
-
-
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 Oct 04 '16 at 02: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 Oct 04 '16 at 08:33