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

RE: reverting to a older revision in svn

From: Edward Ned Harvey <svn_at_nedharvey.com>
Date: Mon, 15 Nov 2010 21:15:43 -0500

> From: Tom Cruickshank [mailto:tcruicksh_at_gmail.com]
>
> Hey Guys,
>      I'm trying to figure out how to revert a file committed into svn to
an older
> revision.
>
> Let's say I have a file called /customers/index.php currently at revision
150,
> and would like to go back to revision 100.
>
> it's the only file I would like to revert. What arguments might I need to
> accomplish this?

svn rm ./foo
svn cp -r 100 foo ./foo

What you've done is delete the file which was created by all the changes
from 100 to 150. Then you've restored rev 100, and commit rev 151. Now, if
you "svn log foo" you'll see the history of the file up to rev 100, and then
a jump directly to 151, skipping all the changes from 101 to 150. You've
basically chopped off the branch that led to a bad file, and re-grafted a
good branch in its place.

If you want to see the bad version again, you could always checkout rev 150.
All the info still exists in repo. But you've deleted that file, and
replaced it with another file having the same name, and part of the same
history.
Received on 2010-11-16 03:16:36 CET

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.