diff --git a/.bash_aliases b/.bash_aliases index 3fdaf43..f3e8f33 100644 --- a/.bash_aliases +++ b/.bash_aliases @@ -223,6 +223,19 @@ gitf () { git fetch -p && git branch -vv | awk '/: gone]/{print $1}' | xargs git branch -D ;; + "r") + local confirm + + read -p "Type 'y' to confirm force rollback of last commit: " confirm + if [ "$confirm" != "y" ]; then + echo "Aborted" + return 0 + fi + + git reset --hard HEAD^ + git push -f + ;; + # Update all git submodules in this repo. "sd" for submodule download. "sd") # Only supports "master" as branch for now. This could cause unexpected results if a tracked submodule has a different branch or location name