Name

svk revert — Undo all local edits.

Synopsis

svk revert PATH...

Description

Reverts any local changes to a file or directory and resolves any conflicted states. svk revert will not only revert the contents of an item in your working copy, but also any property changes. Finally, you can use it to undo any scheduling operations that you may have done (e.g. files scheduled for addition or deletion can be “unscheduled”).

Alternate Names

None

Changes

Working copy

Accesses Depot

Yes

Accesses Mirrored Repository

No

Switches

--recursive (-R)
--quiet (-q)

Examples

Discard changes to a file:

$ svk revert integer.c
Reverted integer.c

If you want to revert a whole directory of files, use the --recursive flag:

$ svk revert --recursive .
Reverted newdir/afile
Reverted foo.c
Reverted bar.txt

Lastly, you can undo any scheduling operations:

$ svk add mistake.txt whoops
A   mistake.txt
A   whoops
A   whoops/oopsie.c
$ svk revert mistake.txt whoops
Reverted mistake.txt
Reverted whoops
$ svk status
?   mistake.txt
?   whoops

Note

If you provide no targets to svk revert, it will do nothing—to protect you from accidentally losing changes in your working copy, svk revert requires you to provide at least one target. ##TODO Sadly currently this is not true and the svk revert actually defaults to . if no path is given.

Tip

You can use svk revert --recursive together with svk checkout --non-recursive to create a sparse working copy tree. Lets say you have a project called multi with 4 subdirectories and you only need the p1 and p2 subdirectories. To do so you could run:

$ svk checkout --non-recursive //multi
Syncing //multi(/multi) in /Users/sally/multi to 11.
 U  multi
$ cd multi
$ svk revert -R p1 p2
Reverted p1
Reverted p1/foo.c
Reverted p2
Reverted p2/bar.c
…