bl-undo
Undo git-branchless operations - recover from mistakes interactively
What this skill does
# /bl-undo - Git-Branchless Undo & Recovery
**Category:** Git Workflow
Recover from mistakes using git-branchless's powerful undo system. Browse repository history and restore previous states.
## Usage
```
/bl-undo [options]
```
## Options
| Option | Description |
|--------|-------------|
| (none) | Quick undo of last operation |
| `-i` | Interactive mode - browse history |
| `--hide <hash>` | Hide a commit from smartlog |
| `--unhide <hash>` | Restore a hidden commit |
## Examples
```bash
# Undo the last operation
/bl-undo
# Interactive undo - browse and select state
/bl-undo -i
# Hide an experimental commit
/bl-undo --hide abc1234
# Restore a hidden commit
/bl-undo --unhide abc1234
```
## What Can Be Undone
- Commits and amended commits
- Rebases and merges
- Branch creations, moves, deletions
- Checkouts
## What Cannot Be Undone
- Uncommitted file changes
- Untracked file changes
- Pushed commits (remote changes)
## Execution
This command delegates to the `bl-undo-expert` agent:
```
Task(subagent_type="git-workflow:bl-undo-expert",
prompt="Execute undo: <options>")
```
## Execution Instructions
1. **Assess Situation**
- Show current state with `git sl`
- Identify what might need undoing
2. **Execute Undo**
- For quick: Run `git undo`, confirm
- For interactive: Run `git undo -i`, guide navigation
- For hide/unhide: Run respective command
3. **Verify Result**
- Show final state with `git sl`
- Confirm expected commits are present
## Interactive Flow
```
User: /bl-undo
Agent: Checking last operation...
Last operation: git rebase -i main
- Dropped: "feat: add OAuth"
- Reordered: 2 commits
This will restore:
◆ abc1234 (main) initial commit
┃
◯ def5678 feat: add auth base
┃
◯ ghi9012 feat: add OAuth ← Will be restored
┃
◯ jkl3456 feat: add Google login
┃
● mno7890 feat: add GitHub login
Undo this operation? [y/n]:
```
```
User: /bl-undo -i
Agent: Opening interactive undo...
git undo -i
This opens a browser interface. Use:
← → arrow keys to navigate through time
Each state shows the smartlog at that point
Find the state BEFORE your mistake
Press Enter to select, then y to confirm
[User navigates in terminal]
After user confirms...
◆ abc1234 (main) initial commit
┃
◯ def5678 feat: add User class
┃
◯ ghi9012 feat: add validation
┃
● jkl3456 feat: add repository
Restored to state before the bad rebase.
All 3 commits recovered.
```
```
User: /bl-undo --hide abc1234
Agent: Hiding commit abc1234...
Before:
◆ main initial commit
┃
◯ abc1234 feat: experimental ← Will be hidden
┃
◯ def5678 feat: add User class
┃
● ghi9012 feat: add validation
git hide abc1234
After:
◆ main initial commit
┃
◯ def5678 feat: add User class
┃
● ghi9012 feat: add validation
Commit hidden from smartlog.
⚠️ Warning: Hidden commits may be garbage collected.
To restore later: /bl-undo --unhide abc1234
```
## Common Recovery Scenarios
### Bad Rebase Removed Commits
```
User: I accidentally dropped a commit during rebase!
Agent: Let's recover it with interactive undo...
/bl-undo -i
Navigate to state before the rebase, select, confirm.
```
### Wrong Commit Amended
```
User: I amended the wrong commit!
Agent: Quick undo will restore it...
/bl-undo
Confirm to restore pre-amend state.
```
### Stack Got Messed Up
```
User: My stack is completely messed up after multiple operations
Agent: Interactive undo can go back multiple operations...
/bl-undo -i
Navigate back to when the stack was correct.
May need to go back several states.
```
### Want to Hide Experimental Work
```
User: I have some experimental commits cluttering my smartlog
Agent: Hide them to clean up the view...
/bl-undo --hide <hash>
They won't show in git sl but can be restored.
```
## Error Handling
| Error | Resolution |
|-------|------------|
| "Nothing to undo" | No recent undoable operations |
| "Working directory dirty" | Stash or commit changes first |
| "Would cause conflicts" | Use `-i` to find different restore point |
| Lost uncommitted changes | Cannot recover - check editor undo |
| Pushed commits | Must revert on remote instead |
## Tips
1. **Commit before risky operations** - Makes undo possible
2. **Use `-i` for complex recovery** - Better visibility of history
3. **Hidden commits aren't permanent** - May be garbage collected
4. **Check result immediately** - Run `git sl` after undo
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.