Undo and Redo¶
stax makes history rewriting safer with transactional operations and built-in recovery.
st restack
# ... conflict or bad outcome
st undo
Transaction model¶
For potentially destructive operations (restack, submit, sync --restack, TUI reorder), stax:
- Snapshots affected branch SHAs
- Creates backup refs at
refs/stax/backups/<op-id>/<branch> - Executes operation
- Writes operation receipt to
.git/stax/ops/<op-id>.json
If needed, st undo restores branches to exact pre-operation commits.
Commands¶
| Command | Description |
|---|---|
st undo |
Undo the last operation |
st undo <op-id> |
Undo a specific operation |
st redo |
Re-apply the last undone operation |
Useful flags¶
--yesauto-approves prompts--no-pushrestores local branches only
If remote branches were force-pushed by the operation, stax offers to restore them too.