View, undo, and restore operations in your workspace using jj’s operation log.
You need to:
Important: The
ops undoandops restorecommands are jj only. Git users can view the operation log (via reflog), but cannot undo through Spec Kitty. See Git Alternative below.
See recent operations:
spec-kitty ops log
Output (format):
Backend: jj
Operation History (jj)
ID Time Description Undoable
abc123 2026-01-17 14:32 Rebase 3 commits onto upstream ✓
def456 2026-01-17 14:27 Commit: add avatar support ✓
Increase the limit:
spec-kitty ops log --limit 50
Get complete operation IDs and details:
spec-kitty ops log --verbose
Backend: jj
Operation History (jj)
ID Time Description Undoable
abc123 2026-01-17 14:32 Rebase 3 commits onto upstream ✓
def456 2026-01-17 14:27 Commit: add avatar support ✓
Full operation IDs:
abc123def456789...
def456ghi789012...
Made a mistake? Undo it:
spec-kitty ops undo
Output:
Undoing operation...
✓ Operation undone successfully
Use 'spec-kitty ops log' to see the updated history.
Undo a specific operation by ID:
spec-kitty ops undo def456
Note: This undoes the specified operation, not everything after it.
Jump to any point in history:
spec-kitty ops restore ghi789
Output:
Restoring to operation ghi789...
✓ Restored successfully
Use 'spec-kitty ops log' to see the updated history.
| Command | What it does |
|---|---|
ops undo |
Reverses the last (or specified) operation |
ops restore |
Jumps directly to a specific historical state |
Example scenario:
Operations: A → B → C → D (current)
ops undo → Undoes D, now at C
ops restore B → Jumps directly to B (skipping C and D)
# Made a commit you didn't want
jj commit -m "Oops, wrong files"
# Undo it
spec-kitty ops undo
# Sync introduced problems
spec-kitty sync
# Go back to before the sync
spec-kitty ops undo
# View history to find good state
spec-kitty ops log --verbose
# Restore to that point
spec-kitty ops restore abc123
# Note your current operation ID
spec-kitty ops log --limit 1
# Try risky changes
# ...
# If it goes wrong, restore
spec-kitty ops restore <saved-id>
Operation IDs are unique identifiers for each state change:
abc123def456789012345678901234567890abcdabc123 (usually sufficient)Use short IDs for convenience:
spec-kitty ops restore abc123
For git-based workspaces, Spec Kitty shows the reflog:
spec-kitty ops log
Operation Log (git reflog)
─────────────────────────────────────────────────
HEAD@{0}: commit: Add user avatar
HEAD@{1}: commit: Initial setup
HEAD@{2}: checkout: moving to feature-WP01
However, ops undo and ops restore are not available for git. Use git directly:
# View reflog
git reflog
# Reset to a previous state
git reset --hard HEAD@{2}
Warning:
git reset --hardis destructive and loses uncommitted changes.
The operation ID may be truncated or incorrect. Use verbose mode to see full IDs:
spec-kitty ops log --verbose
This command requires jujutsu. Check your VCS:
spec-kitty verify-setup --diagnostics
If using git, see Git Alternative.
If undoing would create conflicts, jj stores them as non-blocking conflicts. Check:
jj status
And resolve any conflicts (see Handle Conflicts).
Don’t worry! The operation that contained your work still exists:
# Find the operation with your work
spec-kitty ops log --verbose
# Restore back to it
spec-kitty ops restore <operation-with-your-work>