DubStack
Commands

Recovery

Commands for resuming, canceling, and undoing stack operations.

Continue / Abort

Unified recovery pair for interrupted restacks and rebases:

# Continue active restack/rebase
dub continue

# Abort active restack/rebase
dub abort

Use these when the CLI reports conflicts or an in-progress operation. The typical flow after a conflict is:

# 1. Resolve conflicts in your editor
# 2. Stage resolved files
git add <resolved-files>
# 3. Continue
dub continue

Undo

Reverse the most recent mutating dub command. Backed by a 20-entry ring buffer at .git/dubstack/undo-log.json — older entries are dropped silently.

# Undo the most recent op
dub undo

# Roll back the last N operations in sequence
dub undo --steps 3

# Show what's on the ring (newest first)
dub undo --list

# Wipe both the undo and redo logs
dub undo --clear

Operations covered

CommandReversal
createDeletes the created branch, restores state, checks out previous branch
restack, move, reorder, absorb, unlinkResets every rebased branch tip, restores state
renameRenames branch back, reverses last-pushed ref migration, restores state
popHard-resets the popped branch to its pre-pop tip
modifyRestores the modified branch + descendants to their pre-modify tips
freeze, unfreeze, track, untrackRestores prior state.json (no git refs touched)
deleteRestores stack metadata; surfaces a hint to recreate the local branch manually
syncBest-effort reset of every tracked branch to its pre-sync tip
splitRestores state + branch tips
submitRestores prior PR body via gh pr edit; PR retargeting is not reverted

Partial-success surface

If an undo can't fully succeed (a branch was force-pushed externally, the remote rejected a PR body update, etc.) the command undoes what it can and prints ⚠ … warnings explaining what was skipped and how to clean up manually.

Limitations

  • dub undo does not unpush branches or close PRs created by dub submit.
  • PR base/target retargeting is not reverted — re-run dub submit or gh pr edit <pr> --base <branch> to fix bases manually.
  • For dub delete, the local git branch is not auto-recreated. The warning includes a git branch <name> <sha> recovery command using the SHA recorded at delete time.

Redo

dub redo replays the most recently undone operation by restoring the state and branch tips captured at undo time.

dub redo
  • A new mutating command clears the redo log — only undone operations can be redone.
  • Multiple dub undodub redo cycles are supported; each redo makes the entry undoable again immediately.
  • PR body updates from dub submit are not re-applied by dub redo. Re-run dub submit if you want fresh PR bodies after redoing.

On this page