Category: Recovery

How to abort a git commit amend 0

How to abort a git commit amend

Sometimes you issue a git commit –amend only to realize that you didnt really mean to amend the previous commit. You’d rather save your changes as a new commit. This can happen under many...

How to recover an accidentally deleted branch HEAD in git 0

How to recover an accidentally deleted branch HEAD in git

Its quite possible that you did a git reset –hard and moved your HEAD back to a commit only to realize that you switched back too far behind in your commit history. Apparently everything...

How to revert or rollback your most recent merge in git 0

How to revert or rollback your most recent merge in git

Risky operations like a merge can sometimes leave you unhappy if the merge turned out to be too messy to clean. You can use the below command to go back the the state just...

How to change / revert to a previous commit in git 0

How to change / revert to a previous commit in git

Lets say that your current branch has a set of commits in the order A–B–C–D where A, B, C and D represent the checksums of those commits. Your head is pointing to commit D,...

How to change previous commit message and contents 0

How to change previous commit message and contents

Sometimes you just make a commit and realize that the commit message could have been better. Or that you forgot to add a file. Maybe you just made a commit and then saw that...

How to undo local changes in git 0

How to undo local changes in git

Lets say you have a couple of changes in your working directory that you want to discard. There are a few ways in which you can accomplish this. 1) Stash all your changes, then...