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 :: black web browser github 
Shell :: mongodb show database command linux 
Shell :: git revert pull from another branch 
Shell :: how to check how many files are in a folder linux 
Shell :: git push all branches 
Shell :: bash delete all files of type recursively 
Shell :: delete docker logs linux 
Shell :: gitignore .idea 
Shell :: git@bitbucket.org: Permission denied (publickey). 
Shell :: mac install vagrant 
Shell :: how to uninstall vpython 
Shell :: make file executable linux 
Shell :: An unhandled exception occurred: Collection "@nativescript/schematics" cannot be resolved 
Shell :: gpg generate key 
Shell :: how to install http-server globally 
Shell :: untar gz 
Shell :: start jupyter notebook from terminal 
Shell :: how to see the origin in git 
Shell :: ubuntu isolate workspaces 
Shell :: i forgot the wsl ubuntu root user password 
Shell :: libpng12.so.0 ubuntu 18.04 
Shell :: spacevim installation 
Shell :: test smb connection linux 
Shell :: github epitech 
Shell :: disable selinux 
Shell :: centos7 addgroup 
Shell :: git branch delete remote 
Shell :: bash weather report 
Shell :: bash calculate the mean of a column 
Shell :: how to install intellij on manjaro 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =