← 返回命令列表

Linux command

jj-undo 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Undo last operation

jj undo

Undo the last two operations

jj undo 2

Show the operation log to find operation IDs

jj operation log

Restore to a specific operation by ID

jj operation restore [op_id]

说明

jj undo reverses the last repository operation by creating a new operation that restores the previous state from the operation log. Unlike `jj operation restore`, which discards intermediate operations, `jj undo` preserves the full operation history. The command enables safe experimentation with history. Any jj operation can be undone, including merges, rebases, and bookmark changes.

参数

-R, --repository _path_
Path to the repository to operate on.
--what _what_
What portions of the local state to restore (can be `repo` or `remote-tracking`).
--help
Display help information.

FAQ

What is the jj-undo command used for?

jj undo reverses the last repository operation by creating a new operation that restores the previous state from the operation log. Unlike `jj operation restore`, which discards intermediate operations, `jj undo` preserves the full operation history. The command enables safe experimentation with history. Any jj operation can be undone, including merges, rebases, and bookmark changes.

How do I run a basic jj-undo example?

Run `jj undo` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -R, --repository _path_ do in jj-undo?

Path to the repository to operate on.