You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Graham Leggett <mi...@sharp.fm> on 2006/04/18 11:53:28 UTC

Undoing a commit / replace file with an older revision

Hi all,

I have a file which has been broken and subsequently committed to my
repository. I now want to revert to the previous version.

Both Subclipse' "replace with", and svn update -r<revision> allow me to
revert my file to the revision I specify.

The trouble is, I cannot commit this - because svn complains the file
isn't up to date, so you run svn update, which in turn reverses the
"replace with" and you're back to the broken file you started with.

I can at the moment replace the file with the older version, copy that
file outside the repo, run svn update, and then copy the file back into
the repo over the file and commit that, but that's very klunky.

What is the "correct" way to do this? I couldn't not find anything obvious
in the svn book that covered this.

Regards,
Graham
--



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Undoing a commit / replace file with an older revision

Posted by Andy Levy <an...@gmail.com>.
On 4/18/06, Graham Leggett <mi...@sharp.fm> wrote:
> I have a file which has been broken and subsequently committed to my
> repository. I now want to revert to the previous version.
>
> Both Subclipse' "replace with", and svn update -r<revision> allow me to
> revert my file to the revision I specify.
>
> The trouble is, I cannot commit this - because svn complains the file
> isn't up to date, so you run svn update, which in turn reverses the
> "replace with" and you're back to the broken file you started with.
>
> I can at the moment replace the file with the older version, copy that
> file outside the repo, run svn update, and then copy the file back into
> the repo over the file and commit that, but that's very klunky.
>
> What is the "correct" way to do this? I couldn't not find anything obvious
> in the svn book that covered this.

You probably want a reverse merge.  svn merge -r BADVERSION:GOODVERSION FILENAME

http://svnbook.red-bean.com/en/1.0/ch04s04.html - Scroll down to
"Undoing changes"

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


RE: Undoing a commit / replace file with an older revision

Posted by "Jorge.Uriarte" <jo...@gmail.com>.

Ramaraj Subramanian wrote:
> 
> First delete the broken file and check in the reverted file at this
> location
> 

*Don't*, unless you want to lose history line for this file.
You better do a reverse merge, as Andy suggested.

_
Jorge
--
View this message in context: http://www.nabble.com/Undoing-a-commit-replace-file-with-an-older-revision-t1467666.html#a3968643
Sent from the Subversion Users forum at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org