█████ ██ ██ ██ █████ ██████ ██████
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
███████ ██ ██ ██ ███████ ██████ ██ ██
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
██ ██ ███████ ████ ██ ██ ██ ██ ██████
I previously noted how to undo your last git commit (ie. soft reset). Using Magit:
- M-x magit-log-current.
- Move point to prior revision.
- M-x magit-reset-soft (defaults to revision at point).
Or if you want a single function:
(require 'magit)
(defun ar/magit-soft-reset-head~1 ()
"Soft reset current git repo to HEAD~1."
(interactive)
(magit-reset-soft "HEAD~1"))