/usr/bin/git-undo is in git-extras 1.9.1-2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | #!/bin/sh
back="^"
case "$1" in
-h|--hard)
test $2 -gt 1 > /dev/null 2>&1 && back="~$2"
git reset --hard HEAD$back && exit 0;
;;
-s|--soft)
test $2 -gt 1 > /dev/null 2>&1 && back="~$2"
;;
*)
test $1 -gt 1 > /dev/null 2>&1 && back="~$1"
;;
esac
git reset --soft HEAD$back
git reset
|