undo

vb undo|redo [OPTIONS] [FILENAME...]

Description

The undo command reverts the changes caused by the previous command if the previous command is one of the following:

* vb update
* vb merge
* vb revert
* vb stash pop
* vb stash apply
* vb stash drop
* vb stash goto
* vb clean (*see note below*)

Note: The vb clean command only saves state for files less than 10MiB in size and so if vb clean deleted files larger than that, then vb undo will not recover the larger files.

If FILENAME is specified then restore the content of the named file(s) but otherwise leave the update or merge or revert in effect. The redo command undoes the effect of the most recent undo.

If the -n|--dry-run option is present, no changes are made and instead the undo or redo command explains what actions the undo or redo would have done had the -n|--dry-run been omitted.

If the most recent command is not one of those listed as undoable, then the undo command might try to restore the state to be what it was prior to the last undoable command, or it might be a no-op. If in doubt about what the undo command will do, first run it with the -n option.

A single level of undo/redo is supported. The undo/redo stack is cleared by the commit and check-out commands. Other commands may or may not clear the undo stack.

Future versions of VisionByte might add new commands to the set of commands that are undoable.

Options

-n, --dry-run

Do not make changes, but show what would be done

See Also

See also

commit, status

Examples

  • Init and open a repository

$ vb init undo_repo.vbyte
project-id: 6d6d17bfd9f5a6b916da964065f184e7b3531c4a
server-id:  ef9db6855ead2e9dd75680208f31fdab2ebf3c5b
admin-user: ubuntu (initial remote-access password is "bo3D2mz8WR")
$ vb open -f undo_repo.vbyte
project-name: <unnamed>
repository:   /tmp/sphinx_tests/85f5b639/undo_repo/undo_repo.vbyte
local-root:   /tmp/sphinx_tests/85f5b639/undo_repo/
config-db:    /tmp/sphinx_tests/85f5b639/.visionbyte
project-code: 6d6d17bfd9f5a6b916da964065f184e7b3531c4a
checkout:     e611f3331d80a620644f04b2f5c7014f3140e8d3 2026-03-20 03:04:05 UTC
tags:         trunk
comment:      initial empty check-in (user: ubuntu)
check-ins:    1
  • Make and revert a change, then undo the revert

$ vb sys echo "a" > t.txt
$ vb add t.txt
ADDED  t.txt
$ vb ci -m "base"
Committed version: be08b0b1a996877c897270a5c2ae241398351c0b8deb3dbe27cf10d4ee62db9c
$ vb sys echo "b" >> t.txt
$ vb changes t.txt
EDITED     t.txt
$ vb revert t.txt
REVERT   t.txt
 "vb undo" is available to undo changes to the working checkout.
$ vb changes t.txt --unchanged
t.txt
$ vb undo
UNDO   t.txt
$ vb changes t.txt
EDITED     t.txt