Created
December 7, 2020 11:17
-
-
Save mohnoor94/ab7c685d8ea8e70e890155f9c8d43a40 to your computer and use it in GitHub Desktop.
Revisions
-
mohnoor94 renamed this gist
Dec 7, 2020 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
mohnoor94 created this gist
Dec 7, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ git-uncommit () { if [[ $# -eq 0 ]] then echo '!! Please enter the number of commits you want to undo!' else git reset --soft HEAD~$1 echo ">> Magic done: $1 commit(s) rolled back!" fi } # Undo (Soft reset) last N commits! git-resetHead () { git reset 'HEAD@{1}' echo ">> Magic done: uncommit commands cancelled!" } # Undo 'git reset'!