Answers for "git reset amend"


git undo amend

git reset --soft [email protected]{1}
Posted by: Guest on March-15-2021

git reset amend

# Move the current head so that it's pointing at the old commit
# Leave the index intact for redoing the commit.
# [email protected]{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 [email protected]{1}

# commit the current tree using the commit details of the previous
# HEAD commit. (Note that [email protected]{1} is pointing somewhere different from the
# previous command. It's now pointing at the erroneously amended commit.)
git commit -C [email protected]{1}
Posted by: Guest on July-16-2020

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language