tj.git-extras/bin/git-undo
2012-01-25 11:52:08 -05:00

12 lines
188 B
Bash
Executable file

#!/bin/sh
if test $# -eq 0; then
git reset --hard HEAD~1
else
if `echo $1 | grep -q [^[:digit:]]`; then
echo "$1 is not a number" 1>&2
else
git reset --hard HEAD~$1
fi
fi