[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Is it possible to rollback to an old revision

From: John Szakmeister <john_at_szakmeister.net>
Date: 2004-02-22 15:26:45 CET

On Sunday 22 February 2004 09:07, Phil Thompson wrote:
> Hi there,
>
> I'm using Subversion 0.37.0 win32 binary
> and TortoiseSVN 0.26.0.
>
> Say I have 2 revisions.
>
> Revision 1 - my initial import
> Revision 2 - Changed and added some files
>
> Then I decide it's not going the way I want so I want to rollback to the
> initial import. How do I do it.
>
> It seems as though I can update to revision 1 but this doesn't move the
> HEAD to revision 1 so subsequent updates revert back to Revision 2.
>
> Any ideas how I can make the update to revision a permantent change?

Update can be used to temporarily roll back to a particular version, but not
permanently (as you have noticed). What you need is actually the merge
operation.

svn merge -r2:1 http://url/to/repo/project/trunk .
svn ci -m 'Rolled back to r1' .

The key to this is the arguments to '-r'. This tell svn to use r2 as the base
and then compute the difference against r1, and apply it to the working copy.

The Subversion book talks about doing things like this. Check it out at
svnbook.red-bean.com. This is the section you want in this case:

http://svnbook.red-bean.com/book.html#svn-ch-4-sect-4.2

-John

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Sun Feb 22 15:28:14 2004

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.