'''# Git Detox
Git Detox is your Git safety net. It's a tool that visualizes local Git activity (branches, stashes, reflog, dangling commits) in a unified view and highlights recoverable or at-risk work.
- Scan for Recoverable Work: Detects deleted branches, dangling commits, and dropped stashes.
- Risk Detection: Highlights work at risk of being lost to Git's garbage collection.
- Hygiene Analysis: Identifies merged and stale branches to keep your repo clean.
- Visual TUI: Interactive terminal interface for exploring and restoring your Git history.
- Safe Recovery: Preview commands before execution with guided restoration.
# Clone the repository
git clone https://github.com/youruser/git-detox.git
cd git-detox
# Install in editable mode
pip install -e .git-detox scan: List all recoverable items in the current repository.git-detox show <ID>: View detailed information and diff summary for an item.git-detox restore <ID>: Safely restore an item to a new branch.git-detox health: Get a hygiene report and health score for your repo.git-detox tui: Launch the interactive terminal UI.
$ git-detox scan
Scanning repository...
Recoverable Git Work
┏━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━━━━┓
┃ ID ┃ Type ┃ Source/Ref ┃ Subject ┃ Risk ┃ Date ┃
┡━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━━━━━┩
│ del_abc1234 │ deleted_branch │ feature-x │ Fix login bug │ low │ 2026-02-13 │
└─────────────┴────────────────┴────────────┴─────────────────┴────────┴────────────────┘- Don't Panic: If you just deleted a branch or reset your HEAD,
git-detoxcan likely find it in the reflog. - Check Health Regularly: Use
git-detox healthto keep your local environment lean. - Preview Before Restore: Always use
showto verify the content before restoring.
MIT '''