Reverting to a previous revision using TortoiseSVN
What is the easiest way to revert my working copy to a previous revision using Windows TortoiseSVN?
I did not find any "findable" command to do that quickly.
Solution 1:
There are several ways to do that. But do not just update to the earlier revision as suggested here.
The easiest way to revert the changes from a single revision, or from a range of revisions, is to use the revision log dialog. This is also the method to use of you want to discard recent changes and make an earlier revision the new HEAD.
- Select the file or folder in which you need to revert the changes. If you want to revert all changes, this should be the top level folder.
- Select TortoiseSVN → Show Log to display a list of revisions. You may need to use
Show All
orNext 100
to show the revision(s) you are interested in. - Select the revision you wish to revert. If you want to undo a range of revisions, select the first one and hold Shift while selecting the last one. Note that for multiple revisions, the range must be unbroken with no gaps. Right click on the selected revision(s), then select
Context Menu
→Revert
changes from this revision. - Or if you want to make an earlier revision the new HEAD revision, right click on the selected revision, then select
Context Menu
→Revert to this revision
. This will discard all changes after the selected revision.
You have reverted the changes within your working copy. Check the results, then commit the changes.
All solutions are explained in the "How Do I..." part of the TortoiseSVN docs.
Solution 2:
I have used the same instructions Stefan
used, taken from Tortoise website.
But it's important to click COMMIT right after. I was getting crazy until I realized that.
If you need to make an older revision your head revision do the following:
Select the file or folder in which you need to revert the changes. If you want to revert all changes, this should be the top level folder.
Select TortoiseSVN → Show Log to display a list of revisions. You may need to use Show All or Next 100 to show the revision(s) you are interested in.
Right click on the selected revision, then select Context Menu → Revert to this revision. This will discard all changes after the selected revision.
Make a commit.
Solution 3:
Right click on the folder which is under SVN control, go to TortoiseSVN → Show log. Write down the revision you want to revert to and then go to TortoiseSVN → Update to revision....