I would like to reset my working directory to the state in another commit. In pure git, I'd usegit checkout <commit> -- <file>. Is there a way to reach similar functionality from any of the dispatch popups in magit?
- 1Does this answer your question?How do I checkout a file from another commit in Magitphils– phils2021-06-23 05:12:58 +00:00CommentedJun 23, 2021 at 5:12
1 Answer1
UseM-x magit-checkout-file RET <rev> RET <file RET.
- Is there a pre-defined keyboard shortcut for it in one of the dispatch popups?Nikratio– Nikratio2016-10-03 04:26:52 +00:00CommentedOct 3, 2016 at 4: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– Nikratio2016-10-04 02:21:37 +00:00CommentedOct 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– tarsius2016-10-04 08:33:52 +00:00CommentedOct 4, 2016 at 8:33
Explore related questions
See similar questions with these tags.