Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

git undo amend

git reset --soft HEAD@{1}
Comment

git reset amend

# Move the current head so that it's pointing at the old commit
# Leave the index intact for redoing the commit.
# HEAD@{1} gives you "the commit that HEAD pointed at before 
# it was moved to where it currently points at". Note that this is
# different from HEAD~1, which gives you "the commit that is the
# parent node of the commit that HEAD is currently pointing to."
git reset --soft HEAD@{1}

# commit the current tree using the commit details of the previous
# HEAD commit. (Note that HEAD@{1} is pointing somewhere different from the
# previous command. It's now pointing at the erroneously amended commit.)
git commit -C HEAD@{1}
Comment

git undo amend

git reset --soft "HEAD@{1}"
Comment

PREVIOUS NEXT
Code Example
Shell :: how to convert 30fps to 60fps using ffmpeg 
Shell :: install kube-vip 
Shell :: copy file to other location linux terminal 
Shell :: recover git stash clear 
Shell :: upload file via terminal 
Shell :: concat two txt 
Shell :: git initial commit 
Shell :: how to ignore .idea folder in gitignore 
Shell :: convert to png images liunx 
Shell :: bash cd || exit 
Shell :: what is vi in linux 
Shell :: git checkout -q error: you need to resolve your current index first 
Shell :: fake commit date 
Shell :: command can be used to find files or folders matching a particular search pattern in linux 
Shell :: git unstage a file 
Shell :: My first git commit 
Shell :: symfony skeleton version 
Shell :: cs50 docs 
Shell :: sed output to file 
Shell :: install ripgrep windows 
Shell :: maven homebrew 
Shell :: git clone only single file 
Shell :: decrypt user password linux 
Shell :: how to restore default apache httpd conf file 
Shell :: how to install emmet atom 
Shell :: gatsby-plugin-typography 
Shell :: how to make .gitignore 
Shell :: jupyter command install 
Shell :: git revert to last commit on remote branch 
Shell :: how to delete local master branch in git 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =