Best use case
bl-undo is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Undo git-branchless operations - recover from mistakes interactively
Teams using bl-undo should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/bl-undo/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How bl-undo Compares
| Feature / Agent | bl-undo | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Undo git-branchless operations - recover from mistakes interactively
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# /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 undoRelated Skills
zod
Zod schema validation patterns and type inference. Auto-loads when validating schemas, parsing data, validating forms, checking types at runtime, or using z.object/z.string/z.infer in TypeScript.
typescript-import-style
Merge-friendly import formatting (one-per-line, alphabetical). Auto-loads when writing TypeScript/JavaScript imports to minimize merge conflicts in parallel development. Enforces consistent grouping and sorting.
setup-mcp-auth
Configure authentication for an existing FastMCP server
fastmcp
FastMCP TypeScript framework patterns for MCP servers. Auto-loads when building MCP servers, creating tools/resources/prompts, implementing authentication, configuring transports, or working with FastMCP in TypeScript.
add-mcp-tool
Add a new tool to an existing FastMCP server with guided configuration
add-mcp-resource
Add a new resource or resource template to an existing FastMCP server
plan-with-team
Validate plan file ownership
privacy-compliance
GDPR, CCPA, and privacy compliance guidance for data protection. Use when handling personal data, implementing consent management, or ensuring regulatory compliance across jurisdictions.
oauth
OAuth 2.0 and OpenID Connect implementation patterns. Use when implementing authentication, authorization flows, or integrating with OAuth providers like Google, GitHub, or custom identity providers.
mcp-security
Use when securing MCP servers, preventing prompt injection, implementing authorization, validating user input, or building secure multi-agent pipelines. Provides 5-layer defense architecture patterns.
rag-cag-security
Security patterns for RAG and CAG systems with multi-tenant isolation. Use when building retrieval-augmented or cache-augmented generation systems that require tenant isolation, access control, and secure data handling.
chunking-strategies
Document chunking strategies for RAG systems. Use when implementing document processing pipelines to determine optimal chunking approaches based on document type and retrieval requirements.