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

Re: How to undo a commit?

From: Ryan Schmidt <subversion-2009a_at_ryandesign.com>
Date: Sat, 28 Mar 2009 17:53:29 -0500

On Mar 28, 2009, at 13:38, B Smith-Mannschott wrote:

> On Sat, Mar 28, 2009 at 19:30, Kynn Jones wrote:
>
>> By mistake, I ran the following command while in the wrong directory:
>> svn commit -m 'a lengthy description string'
>> This was a big mistake: The directory in question was not even
>> part of the
>> project that I thought I was working with! Hence, the lengthy
>> message that
>> I passed as the argument to the -m option is wholly inappropriate,
>> and in
>> fact misleading. (In addition, a couple of files got committed
>> prematurely
>> to the repository, but this is the lesser problem.)
>>
>> Is there a straightforward way to undo this mistake, and delete the
>> incorrect message?
>> I assume the answer is no, since Subversion is designed to "keep
>> everything". In this case, what's the best approximation to a
>> full delete
>> of this incorrect message?
>
> http://subversion.tigris.org/faq.html#change-log-msg

Right, that will help you change the commit message after the fact.
So you could edit the log message to say "Accidental commit; reverted
in r123".

But first, to actually revert the changes, you could do a reverse
merge, described here:

http://svnbook.red-bean.com/en/1.5/
svn.branchmerge.basicmerging.html#svn.branchmerge.basicmerging.undo

Once you commit that reverse merge, then you'll have the revision
number so that you can rewrite the log message as above.

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=1462345

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-03-28 23:54:26 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.