Wednesday, August 5, 2009

Going back to earlier revisions in Subversion

There are basically two different scenarios where you will want to rewind (AKA roll back, revert) your code base to an earlier version.
  1. You just want to have an earlier version of the code, but don't need to work-on / commit-against the earlier revision.
  2. You actually want to roll your project back to an earlier version and then work-on / commit-against the project with the earlier revision as your starting point.
To accomplish #1, you simply update your code back to the earlier revision (yeah, it's an update operation even though you're going backwards). Alternatively, if you want to be very antiseptic, you could checkout the earlier revision.

#2 is considerably more complicated. There are hacky ways to handle it, but the "proper" method is described here:

No comments:

Post a Comment