Jujutsu records every operation you perform in an immutable log. This enables powerful features like undo, redo, and time-travel debugging.
What is the Operation Log?
The operation log is a complete history of all changes to the repository:
bash
jj op log
@ cfa4e4473cbe 3 minutes ago k@example.com
│ rebase commit 5f06c89cd71f17f8b1f44a6e94fe5b338bdc6b27
│ args: jj rebase -d main
│
○ 6e86d8020ede 10 minutes ago k@example.com
│ describe commit f0e10b9ab7f34bd78f6f4a42e5c7a0f1b2c3d4e5
│ args: jj describe -m "Add authentication"
│
○ 8f92c55612f1 15 minutes ago k@example.com
new empty commit
args: jj new main -m "Add authentication"Each entry records:
- Operation type: rebase, describe, new, etc.
- Timestamp: When it occurred
- User: Who performed it
- Args: The exact command
- Changes affected: Which changes were modified
Basic Operations
Undo
Undo the most recent operation:
bash
jj undoThis restores the repository to its state before the last operation.
Undo Specific Operation
bash
jj op log
# Find operation ID (e.g., 6e86d8020ede)
jj undo --op 6e86d8020edeRedo
Reverse an undo:
bash
jj op restore @
# Restores to the most recent state (reversing the undo)Advanced Usage
Restore Any Point
bash
jj op log
# Find desired state
jj op restore 8f92c55612f1
# Repository is now exactly as it was at that pointView Operation Details
bash
jj op show 6e86d8020ede
# Shows full details of that operationAbandon Operations
Hide operations from log (they still exist):
bash
jj op abandon 6e86d8020edeUse Cases
1. Recovering from Mistakes
bash
# Oops, rebased wrong branch
jj rebase -s wrong-change -d main
# Undo and try again
jj undo
jj rebase -s right-change -d main2. Experimenting Safely
bash
# Try a complex rebase
jj rebase -s abc123 -d def456
# Doesn't look right?
jj undo
# Back to safe state3. Understanding History
bash
# What did I do yesterday?
jj op log --since "yesterday"
# What changed this specific file?
jj op log --grep "file.txt"4. Debugging Agent Actions
When agents perform operations:
bash
jj op log
# Shows all agent operations with full context
jj op show agent-operation-id
# See exactly what the agent didKizuna UI
Operation Log Viewer
Navigate to Repository → Operations for a visual timeline:
Timeline ─────────────────────────────────
Today
├─ 09:00 rebase (agent: code-reviewer)
├─ 08:55 describe
└─ 08:50 new
Yesterday
├─ 16:30 squash
└─ 16:25 amendInteractive Restore
Click any operation to:
- View details
- See diff from previous state
- Restore to that point
API Access
List Operations
bash
curl /api/v1/repos/org/repo/operationsGet Operation Details
bash
curl /api/v1/repos/org/repo/operations/abc123Restore via API
bash
curl -X POST /api/v1/repos/org/repo/operations/abc123/restoreBest Practices
- Don't fear experimentation — Undo is always available
- Use descriptive messages —
jj describehelps future debugging - Check op log when confused — See exactly what happened
- Restore carefully — Affects all changes, not just one
Comparison with Git
| Aspect | Git | Jujutsu |
|---|---|---|
| Undo | git reset (destructive) | jj undo (safe) |
| History | reflog (local only, temporary) | Operation log (persistent, shared) |
| Visibility | Command history | Structured operations |
| Granularity | Commit-level | Operation-level |
Summary
The operation log transforms version control from a "hope you don't make mistakes" system to an "explore freely, recover easily" system.
Key benefits:
- Safety: Any operation can be undone
- Transparency: Complete audit trail
- Debugging: Understand exactly what happened
- Confidence: Experiment without fear