I sometimes want to undo a commit without losing the changes, but just placing them back into an uncommitted and unstaged state. To do that at the cli, I do just
git reset <sha-of-previous-commit>.
How would I do the same in magit?
Emacs Stack Exchange is a question and answer site for those using, extending or developing Emacs. It only takes a minute to sign up.Sign up to join this community
Use x or X s to do so.
Using the X prefix has the benefit that it shows you all the available
git reset variants.
This is also documented in the Resetting section of the manual.