记一次git清理历史危机

# How to Recover Lost Git Branches After a Disastrous `filter-branch` Operation

![Git branches recovery illustration](https://example.com/git-recovery-image.jpg)
*When Git history rewriting goes wrong – but there’s hope!*

Have you ever accidentally nuked all your Git branches with a reckless `git filter-branch` command? Don’t panic! This guide will walk you through 4 proven methods to resurrect your lost branches, even if you thought all hope was lost.

## Why This Happens
The nuclear option:
git filter-branch –force –index-filter “git rm -r –cached –ignore-unmatch ./” –prune-empty –tag-name-filter cat — –all