redo¶
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
Examples¶
Init and open a repository
$ vb init undo_repo.vbyte
project-id: 45249025b079bf2c8086672e7be6b31243f0ef52
server-id: 6561c7bf1682a0e4a3c233e1860a8cdc2860f750
admin-user: ubuntu (initial remote-access password is "nRHsbt6Adq")
$ vb open -f undo_repo.vbyte
project-name: <unnamed>
repository: /tmp/sphinx_tests/cb478ae8/undo_repo/undo_repo.vbyte
local-root: /tmp/sphinx_tests/cb478ae8/undo_repo/
config-db: /tmp/sphinx_tests/cb478ae8/.visionbyte
project-code: 45249025b079bf2c8086672e7be6b31243f0ef52
checkout: 6ca7d6e2e0304a2ea585b1c95850a01d76685898 2026-03-31 13:00:34 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: 2b7aaed97014b80af704185a01ac438c9bb80de2314af483e8d95829b24fec3b
$ 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