LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

jj-operation-revert

revert a single Jujutsu operation by applying its inverse

TLDR

Revert the current operation
$ jj operation revert
copy
Revert a specific operation (not necessarily the latest)
$ jj op revert [operation-id]
copy
Revert only repo state and local bookmarks
$ jj op revert --what repo [operation-id]
copy
Find an operation ID
$ jj op log
copy
Undo the last operation (top-level equivalent for the latest)
$ jj undo
copy

SYNOPSIS

jj operation revert [options] [operation]

DESCRIPTION

jj operation revert (alias jj op revert) creates a new operation that applies the inverse of an earlier operation. The original operation stays in the log; the new one undoes its effect on the recorded repo view.This is the operation-log analog of jj revert (which inverts a commit). Use it when you want to undo one command that is not necessarily the most recent. jj undo is the usual way to walk back the latest operation(s) one-by-one. jj op restore instead replaces the current view with a whole earlier snapshot, undoing every operation after that point rather than inverting a single one.Default @ means "revert the current operation", which is close to jj undo for a single step. To invert something older, pass its ID from jj op log.

PARAMETERS

OPERATION

The operation to revert. Default: `@` (the current operation). Copy an ID from jj op log.
--what WHAT
Experimental. Which portions of the local state to restore (repeatable). Default: `repo` and `remote-tracking`. `repo` is the jj repo state and local bookmarks. `remote-tracking` is remote-tracking bookmarks — omit it if you want to push after the revert without resetting those refs.
--help
Display help information.

INSTALL

sudo pacman -S jujutsu
copy
sudo apk add jujutsu
copy
sudo zypper install jujutsu
copy
brew install jujutsu
copy
nix profile install nixpkgs#jujutsu
copy

CAVEATS

Subcommand of jj. Operation IDs come from jj op log, not from jj log. Revert adds a new operation; it does not delete history. --what is experimental. This is not jj revert, which creates a new commit that undoes a revision. Inverting an operation that had effects outside the repo (for example a jj git push) does not un-push.

SEE ALSO

RESOURCES

Copied to clipboard
Kai