0

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

Dushyant Joshi
  • 3,672
  • 3
  • 28
  • 52

3 Answers3

1

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

svn up -r[NUMBER]
ziollek
  • 1,973
  • 1
  • 12
  • 10
1

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.

Community
  • 1
  • 1
mmilleruva
  • 2,110
  • 18
  • 20
0

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

sincerekamal
  • 127
  • 1
  • 2
  • 10