How do I “un-revert” a reverted Git commit?

git cherry-pick <original commit sha> Will make a copy of the original commit, essentially re-applying the commit Reverting the revert will do the same thing, with a messier commit message: git revert <commit sha of the revert> Either of these ways will allow you to git push without overwriting history, because it creates a new … Read more

Undoing a git rebase

The easiest way would be to find the head commit of the branch as it was immediately before the rebase started in the reflog… git reflog and to reset the current branch to it (with the usual caveats about being absolutely sure before reseting with the –hard option). Suppose the old commit was HEAD@{2} in … Read more