From 1ab2a72d932080269236fa3db4236d496c3c89f0 Mon Sep 17 00:00:00 2001 From: Will Hilton Date: Sun, 31 Jan 2016 14:11:24 -0500 Subject: [PATCH] Made reset command safer --- bin/get | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/get b/bin/get index 4f2a93c..ed5d367 100755 --- a/bin/get +++ b/bin/get @@ -119,8 +119,13 @@ fi reset) echo Resetting if [ -z "$2" ]; then + # OK so I typed "reset" instead of "unstage" (because unstage == git reset --mixed) + # and lost 3 hours of work. So we're not using this command anymore. + #git checkout -f HEAD + # We can achieve the same effect of reseting the working directory using git stash, + # which has the benefit of being reversable. + git stash save echo The working directory has been reset. - git checkout -f HEAD else git checkout "${@:2}" fi