twilblog / twilblog.github.io

This Week I Learned
4 stars 1 forks source link

"Recovering a deleted merged Git branch" blog is wrong #34

Open sgpinkus opened 2 years ago

sgpinkus commented 2 years ago

This post states given this merge commit:

commit <very long SHA here>
Merge:  <more SHA stuff>
Author: Hermione Granger <hgranger@ministryofmagic.uk>
Date:   Thu Nov 26 10:09:00 2015 +0000

   Merged in branch-to-recover (pull request #100)

You recover the merged and deleted branch from commit: <very long SHA here>. This is wrong. The deleted branch's head commit is one of the hashes in <more SHA stuff>. You recover it with that hash. I realize it's an old small personal blog post but the post is fairly highly ranked on search engines. Can you please fix this?