LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

jj-undo

reverses the last repository operation

TLDR

Undo last operation
$ jj undo
copy
Undo the last two operations
$ jj undo 2
copy
Show the operation log to find operation IDs
$ jj operation log
copy
Restore to a specific operation by ID
$ jj operation restore [op_id]
copy

SYNOPSIS

jj undo [options] [count]

DESCRIPTION

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.

PARAMETERS

COUNT

Number of operations to undo.
-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.

CAVEATS

Subcommand of jj. Undoes jj operations only. Operation log has retention limit.

HISTORY

jj undo is part of Jujutsu, leveraging its operation log for powerful undo capabilities.

SEE ALSO

Copied to clipboard
Kai