From b6a5d0f32bb75d653f7e3416e0f1ffe282a1a652 Mon Sep 17 00:00:00 2001 From: Victor Westerlund Date: Tue, 24 Feb 2026 13:43:20 +0100 Subject: [PATCH] feat(git): add gitf r to force rollback the last commit --- .bash_aliases | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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