Skip to content
bl-undo logo

/bl-undo - Git-Branchless Undo & Recovery

bl-undo

Undo git-branchless operations - recover from mistakes interactively

SKILL.md

Full skill instructions

/​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

OptionDescription
(none)Quick undo of last operation
-iInteractive mode - browse history
--hide <hash>Hide a commit from smartlog
--unhide <hash>Restore a hidden commit

Examples

# 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

ErrorResolution
"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 changesCannot recover - check editor undo
Pushed commitsMust 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

More Productivity & Planning skills

brainstorming logo
Productivity & Planning

brainstorming

Structured design dialogue that validates ideas before implementation begins.

295.4K 385.7K
View
ui-ux-pro-max logo
Productivity & Planning

ui-ux-pro-max

Comprehensive design intelligence for web and mobile UI/UX across 10 technology stacks.

133.1K 383.9K
View
writing-plans logo
Productivity & Planning

writing-plans

Comprehensive implementation plans for multi-step tasks, breaking down specs into bite-sized, testable steps.

295.4K 268K
View
using-superpowers logo
Productivity & Planning

using-superpowers

Introduction to the obra skills system with mandatory skill invocation rules and best practices.

295.4K 259.8K
View
executing-plans logo
Productivity & Planning

executing-plans

Execute a written implementation plan with critical review and task checkpoints.

295.4K 229.1K
View
dispatching-parallel-agents logo
Productivity & Planning

dispatching-parallel-agents

Delegate independent tasks to specialized agents working concurrently with isolated context.

295.4K 206.3K
View
using-git-worktrees logo
Productivity & Planning

using-git-worktrees

Isolated git worktrees with smart directory selection and safety verification.

295.4K 205.2K
View
webapp-testing logo
Productivity & Planning

webapp-testing

Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.

179.7K 170.6K
View
content-strategy logo
Productivity & Planning

content-strategy

Plan searchable and shareable content that drives traffic, builds authority, and generates leads.

53.3K 150.9K
View
repo-intake-and-plan logo
Productivity & Planning

repo-intake-and-plan

README-first repository scanner that extracts commands and classifies reproduction candidates without executing them.

497 139.6K
View
marketing-ideas logo
Productivity & Planning

marketing-ideas

Brainstorm and prioritize marketing strategies tailored to your SaaS stage, budget, and goals.

53.3K 137.2K
View
site-architecture logo
Productivity & Planning

site-architecture

Plan and optimize your website's page hierarchy, navigation, URL structure, and internal linking.

53.3K 112.8K
View

Productivity AI tools

Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View
SaveDay logo
Productivity

SaveDay

Capture, organize, and utilize your knowledge effortlessly.

Free
View
A
Productivity

Any Summary

Instant Summaries of Audio & Video Interviews with AnySummary

Freemium
View
M
Productivity

Map This

Transform PDFs into engaging mind maps.

Freemium
View
ChatPDF logo
Productivity

ChatPDF

Chat with any PDF instantly

Free
View
I
Productivity

intellisay

Create an optimal daily plan using your voice

Paid
View
A
Productivity

Aurora AI

A productivity platform to centralize organizational knowledge and workflows with contextual AI assistance.

Paid
View
AskYourPDF logo
Productivity

AskYourPDF

AskYourPDF Pricing Plans: Tailored to Your Needs

Free
View