I'm looking for a way to undo changes in selected directory, analogue of git checkout [folder-path] in Magit.

I found that I can reset changes of specific file to selected branch by typing X f in magit-status, but I didn't find a way to do the same for folders.

Is there a way to achieve that in Magit?

  • 1
    You can select all the relevant changes in the status buffer, and type k to kill them. – phils Jan 20 at 23:47
  • @phils yes but it's still per file rather than entire folder. – Navidot Jan 21 at 8:18
  • 1
    Sure. But as with git itself, magit only shows you files rather than directories (the latter being implicit in the former). If you particularly don't want to deal with files, I would just use : to run the git command line you initially mentioned. – phils Jan 21 at 12:23
  • Thanks, I think : is what I was looking for. – Navidot Jan 21 at 20:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.