
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Common Use-Cases for Merging
|
65
upon one another. Removing a revision from history would cause a domino effect, cre-
ating chaos in all subsequent revisions and possibly invalidating all working copies.
*
Resurrecting Deleted Items
The great thing about version control systems is that information is never lost. Even
when you delete a file or directory, it may be gone from the
HEAD revision, but the
object still exists in earlier revisions. One of the most common questions new users
ask is, how do I get my old file or directory back?
The first step is to define exactly which item you’re trying to resurrect. Here’s a use-
ful metaphor: you can think of every object in the repository as existing in a sort of
two-dimensional coordinate system. The first coordinate is a particular revision tree,
and the second coordinate is a path within that tree. So every version of your file or
directory can be defined by a specific coordinate pair.
Subversion has no Attic directory as CVS does,
†
so you need to use svn log to dis-
cover the exact coordinate pair you wish to resurrect. A good strategy is to run
svn
log --verbose
in a directory which used to contain your deleted item. The --verbose
option shows a list of all changed items in each revision; all you need to do is find the
revision in which you