Recovering a deleted branch

tldr; This assumes you have not run git clean on your repo. Find unreachable commits: git fsck --full --no-reflogs --unreachable --lost-found | grep commit Find the commit you are looking for: git cat-file -p bb00fa599994c3d6f80f99af4cadc8a145ab22e5 Restore: git branch branch_name bb00fa599994c3d6f80f99af4cadc8a145ab22e5 The Cause I was doing some work on a project I had not recently worked on. During “re-boarding” I was looking through the branches I had created and not cleaned up before starting a new task in a different project....

April 4, 2023 · 4 min · BB