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 revert amend

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

PREVIOUS NEXT
Code Example
Shell :: OSError: [Errno 24] inotify instance limit reached 
Shell :: delete branch from remote 
Shell :: docker-compose clear cache 
Shell :: how to change git remote origin 
Shell :: install teamviewer ubuntu 20.04 
Shell :: ip address ubuntu 
Shell :: install snap fedora 
Shell :: remove iptables rule 
Shell :: curl get-pip 
Shell :: clear bash history 
Shell :: install opera linux terminal 
Shell :: wtforms install 
Shell :: restart nginx server 
Shell :: ssh key mac 
Shell :: install docker kali linux 
Shell :: terraform apply auto approve 
Shell :: update composer globally 
Shell :: restart ssh on windows 
Shell :: brew install atom 
Shell :: install filezilla ubuntu 
Shell :: delete empty files bash 
Shell :: list recently installed packages arch 
Shell :: how to extract zip file in ubuntu terminal 
Shell :: git commit change message after push 
Shell :: homebrew restart redis 
Shell :: how to install mongoose 
Shell :: install cloudlinux centos with cpanel 
Shell :: git fetch all remote branch 
Shell :: docker install script 
Shell :: install rabbitmq on ubuntu 18.04 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =