From 83c9455fc0ef2b14be890aa0fc09a8daced43bfa Mon Sep 17 00:00:00 2001 From: Sameer Rahmani Date: Mon, 5 Sep 2022 15:33:56 +0100 Subject: [PATCH] Uncommit command has been added --- lib/git.zsh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/git.zsh b/lib/git.zsh index c9c51da..7bb22de 100755 --- a/lib/git.zsh +++ b/lib/git.zsh @@ -155,6 +155,11 @@ function git_reset_branch_commits() { git reset $(git merge-base $1 $(git branch --show-current)) } +function git-uncommit() { + git reset --soft HEAD~1 + git restore --staged . +} + #this is unlikely to change so make it all statically assigned POST_1_7_2_GIT=$(git_compare_version "1.7.2") #clean up the namespace slightly by removing the checker function