I'm beginning with Git and Magit so I don't know to which one my question is specific.
Sometimes I save changes to a file but then don't want to commit them: I simply want to go back to the last commit.
I'm trying to do this from Emacs / Magit and what I do is just insane:
- I stash the changes (otherwise Magit complains about uncommited/unstashed changes)
- I checkout a commit older than the last one (if I simply try the last one Emacs / magit just leaves my changes there: it doesn't modify the file)
- I drop the stash
- I checkout the last commit
This requires lots of keypresses and is absolutely mad.
I'm surely missing something totally obvious but simply can't find what: so I do efficiently drop from Emacs / Magit the last saved changes and simply go back to the last commit?