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

Re: Reverting out of a commit

From: Christopher Ness <chris_at_nesser.org>
Date: 2005-07-26 19:20:39 CEST

On Tue, 2005-07-26 at 09:51 -0700, Ron Gilbert wrote:
> What is the best way to revert out of a commit on a single file? I
> had a situation yesterday where a (binary) file was committed that
> was corrupt (not svn's fault). It was the head, and I just wanted to
> removed it, but I could not find a good way to do this. I ended up
> pulling down the previous version and tried to commit that, but it
> would not let me because it was not current, so I had to modify the
> file before committing it.
>
> This seem very cumbersome. Is there a way to remove the head, or
> quickly make another revision the head?

If HEAD = 100 and you have a working copy of the changes then to revert
the last commit (which is revision 100):
    svn up # Update your working copy
    svn merge -r100:99 . # Reverse merge the changes made in 100
      ** Inspect the changes made to make sure you are happy with them
    svn commit # Send changes to the repository

This will revert ALL changes in commit 100, which you probably don't
want to do.

If you simply want to remove a file from the repository:
   svn help rm

Perhaps the best way would be to place the non-corrupt binary file into
your working copy and then commit your changes.
This will make a new HEAD revision with the updated file.

HTH's,
Chris

-- 
Wireless Group
McMaster University
summer
13:13:45 up 4 days, 23:06, 5 users, load average: 0.10, 0.18, 0.17
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Jul 26 19:22:43 2005

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.