Emacs, scripting and anything text oriented.

How to undo the unpushed commits in magit?

Kaushal Modi

In Magit buffer *magit: ..*,

  • Hit x
  • Select origin/master

Above action will undo all the commits that haven’t been pushed to origin/master. It will still preserve the modified states of the yet-to-be staged/committed files.

If you have written a response to this, enter your response post's URL below.

Or, you can send a "comment" webmention (it's OK if you don't know what that means). When asked about your website on an IndieAuth login screen, simply type https://commentpara.de.

Markdown Support**bold**, _italics_, ~~strikethrough~~, [descr](link), `monospace`, ```LANG\nline1\nline2\n``` (Yep, multi-line code blocks too, with syntax highlighting!), auto-hyperlinking.

Webmentions #