Santosh kumar
Santosh kumar

Reputation: 93

Rollback svn update tp previous state

I am in big trouble.

I committed from my local & took svn update on my server. That caused several files added or updated. It includes commit from other users too.

However I want to revert update & go back to previous state. please help

Thanks in advance

Upvotes: 0

Views: 155

Answers (3)

mmilleruva
mmilleruva

Reputation: 2178

I believe what you are trying to do is actually undo your changes in the repository. Simply performing svn update -r myrevision will update your working copy to the revision before you made the bad commit, but it will not get rid of the mistaken changes from the repository. Here is how to remove them (in Tortoise):

  1. Make sure your working copy has the latest update
  2. Go to Tortoise SVN -> Show Log
  3. Right click on the revision you want to get rid of and select "Revert Changes From This Revision", then follow the dialog box. If you are using svn on the command line, see this post SVN reverse merge?
  4. Commit your new code.

This is performing a reverse merge. So SVN looks at the changes made in that revision and attempts to undo them in current the current revision. This is the same process as trying to do a regular merge only backwards, so there is the possibility that you will have merge conflicts which you will need resolve. Your mistaken commit will still be in the repository, but the most recent version of your code should have all of the changes made during the bad commit removed.

Upvotes: 1

sincerekamal
sincerekamal

Reputation: 127

For GUI-client (Tortoise SVN for windows):

Step 1. Go to your working directory. Right click -> TortoiseSVN -> Show Log

Step 2: Note down the revision number to which you want to revert

Step 3: Open your server and type the command svn up -r revision-number

Upvotes: 0

ziollek
ziollek

Reputation: 1993

If you know last stable revision number, you can simply update to this revision:

svn up -r[NUMBER]

Upvotes: 1

Related Questions