Posting this as a reference for my future self, so I don't have to search every time.
git commit --amendwill update and replace the most recent commit with a new commit that combines any staged changes with the contents of the previous commit. With nothing currently staged, this just rewrites the previous commit message.
-m 1option tells Git that we want to keep the parent side of the merge (which is the branch we had merged into). Finally, also make sure to provide the correct commit hash: when using git revert, we have to specify the actual merge commit's hash.
git branch -Ddelete
git reflogto get the commit SHA before you deleted the branch
git resetto reset :)
git stash pop/drop/clear
git stash apply
Make sure that diff coloring is set to auto in your
.gitconfigotherwise the command will fail with unrecognised input.
Only works for annotated tags, tags created using
git tag -a
git fsckto check for dangling/unreachable commits.
git tag -lto verify
git restoreto restore the file :)
Undoing a git merge is a risky business. Please proceed with caution
ORIG_HEADpoints to the original commit before the merge. So we are just resetting that