Skip to content

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 undo

This 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 6e86d8020ede

Redo ​

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 point

View Operation Details ​

bash
jj op show 6e86d8020ede
# Shows full details of that operation

Abandon Operations ​

Hide operations from log (they still exist):

bash
jj op abandon 6e86d8020ede

Use 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 main

2. Experimenting Safely ​

bash
# Try a complex rebase
jj rebase -s abc123 -d def456

# Doesn't look right?
jj undo
# Back to safe state

3. 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 did

Kizuna 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  amend

Interactive 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/operations

Get Operation Details ​

bash
curl /api/v1/repos/org/repo/operations/abc123

Restore via API ​

bash
curl -X POST /api/v1/repos/org/repo/operations/abc123/restore

Best Practices ​

  1. Don't fear experimentation — Undo is always available
  2. Use descriptive messages — jj describe helps future debugging
  3. Check op log when confused — See exactly what happened
  4. Restore carefully — Affects all changes, not just one

Comparison with Git ​

AspectGitJujutsu
Undogit reset (destructive)jj undo (safe)
Historyreflog (local only, temporary)Operation log (persistent, shared)
VisibilityCommand historyStructured operations
GranularityCommit-levelOperation-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