MathJax

Wednesday, July 21, 2021

Redoing a reverted merge

The consequence of reverting a merge and how it should be handled when the re-merging.

https://stackoverflow.com/questions/1078146/re-doing-a-reverted-merge-in-git

http://blog.jdwyah.com/2015/07/dealing-with-git-merge-revisions.html

Official source

https://mirrors.edge.kernel.org/pub/software/scm/git/docs/howto/revert-a-faulty-merge.txt

Monday, July 19, 2021

Reverting a sequence of commits in git

This command lets you revert to any commit in the branch without modifying git history.  It appends the modifications to the current head of the branch.

$ git reset --hard A
$ git reset --soft D # (or ORIG_HEAD or @{1} [previous location of HEAD]), all of which are D
$ git commit

https://stackoverflow.com/questions/1463340/how-to-revert-multiple-git-commits/1470452#1470452