Undoing Operations in Jujutsu

Undo recent jj operations and restore repository state via the operation log.

78|6|Updated May 19, 2017
One-click install
npx skills add https://github.com/edmundmiller/dotfiles --skill undoing-operations-in-jujutsu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Undoing Operations in Jujutsu
Source: https://github.com/edmundmiller/dotfiles/tree/main/config/claude/plugins/jj/skills/jj-undo
Command: npx skills add https://github.com/edmundmiller/dotfiles --skill undoing-operations-in-jujutsu

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill explains how to undo recent and multiple operations in jj, including common patterns for squashes, describes, and splitting, with guidance on redo workflows.

Core Features & Use Cases

  • Single-step undo: Revert the most recent operation quickly.
  • Multiple undo steps: Step back through a chain of operations safely.
  • Redo workflows: Reapply previously undone changes when needed.

Quick Start

When you make a mistaken change, run an undo to revert the latest operation, then describe the new state if needed.

Frequently Asked Questions about Undoing Operations in Jujutsu

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I undo the last operation in jj?

Undo the most recent operation in jj by running `jj undo`. This reverts your repository to the state before that operation, whether it was a describe, squash, split, or commit, while preserving your working copy.

Can I undo multiple operations at once in jj?

Yes, undo multiple operations by running `jj undo` repeatedly to step back through your operation history. Each command reverts one operation, letting you walk back safely through a chain of changes.

How do I redo an operation after undoing it in jj?

Redo undone operations by checking `jj op log` to view your operation history, then use `jj op restore` with the operation ID to restore to a specific point in time and reapply previously undone changes.

What happens to my working copy when I undo in jj?

When you undo an operation in jj, the repository state reverts while your working copy remains consistent. Auto-snapshots before each operation ensure you can safely step back without losing uncommitted work.

Can I undo a describe, squash, or split operation in jj?

Yes, `jj undo` works across common workflows including describe, squash, split, and commit operations. Each undo safely reverses the most recent operation and restores the prior repository state.

What's the difference between `jj undo` and `jj op restore` in jj?

`jj undo` reverts a single recent operation quickly. `jj op restore` restores your repository to any specific point in the operation log using its ID, giving you more precise control over which past state to return to.