delete commit 1

delete commit

# Removes latest commit from the stash, KEEPS changes
git reset --soft HEAD~

# Removes latest commit from the stash, DELETES changes
git reset --hard HEAD~

Here is what the above code is Doing:
1. git stash -u -k -a -q –keep-index
-u: untracked files
-k: keep index
-a: all files
-q: quiet
–keep-index: keep index
2. git stash drop
drop the latest stash
3. git reset –soft HEAD~
reset the latest commit

Similar Posts