There is a convenient alias setting with git called ORIG_HEAD, which tracks the last used header. Therefore, when you do git reset --hard HEAD ~ 1, the data about the head that you only reset away is stored in ORIG_HEAD.
so the alias git prev git reset --hard HEAD ~ 1 (or HEAD ^ 1) and the alias git next to git reset --hard ORIG_HEAD
jkeating
source share