AnkhSvn undo/revert a commit
Asked Answered
A

3

4

How do I undo/revert a change I've commited, with AnkhSvn/VS 2010. (I'm well aware you can't "delete" stuff in the subversion repository).

The issue is simple, You're working on HEAD(e.g. rev 100). You figure out something is broken. You view the history, and figure out rev 93 might be the issue. You want to revert the change done in rev 93, test, and commit those reverted changes.

While I know how to resort to the command line to "undo" this, How do you do this with AnkSvn from within Visual Studio ?

Agadir answered 18/1, 2011 at 11:55 Comment(3)
AnkhSVN is convenient for day-to-day tasks, but I consider it too restricted and too broken to use for anything beyond simple update / commit activity.Underrate
@Underrate undoing changes works quite well. If anything is broken, you should file a bug report about it so it can be fixed.Bobble
I prefer using the command line... and I'm calling it 'broken' not so much because of the occasional bug, but because of the way it automatically assumes that "in the solution" and "under version control" should be the same thing.Underrate
B
8

Go to the history viewer (Right-click solution -> View Solution history), here right-click on a revision (or a selection of revisions), and use the items in the context menu to undo your changes.

Bobble answered 18/1, 2011 at 12:11 Comment(1)
Thanks. Apparently that only works if you're viewing history on a project or solution, not filesAgadir
G
0

I use the following process:
With the solution working on the trunk HEAD and with no local files, right click the Solution, go Subversion -> merge

The Merge Wizard will pop up.

On the first page select 'Merge two different trees'

On the second page you want the 'From' to be the HEAD (Latest Version) and 'To' to be the specific revision to roll back to (93 in OP case) and using the 'From' URL.

On the third page, for text and binary conflicts I have 'prompt me for each' selected. I have depth as 'working copy' and leave 'Ignore ancestry' and 'allow unversioned obstructions' unchecked.

On the final Merge Summary page perform a dry-run first, check to see that the changes look correct. Then run the merge.

Finally, commit the changes to the trunk.

Goggin answered 4/2, 2015 at 23:29 Comment(0)
B
0

AnkhSVN wasn't working when I did Update to a Specific Version, I kept getting an error message about "please update the out of date items and then retry commit". After some trial and error I figured out how to undo a committed file using the command Revert to this revision.

Say for example you are at revision 4440 and you want to make 4435 the new head. Use Revert to this revision to discard all changes after the selected revision.

How to make a prior committed version the new HEAD revision

NOTE: You may want to revert an entire a solution, but keep a couple changes made in the "un-done" revisions. If that's the case before you revert you could: copy out the newer files to a temporary location, do the revert, then copied them back in to revert everything but keep a few changed at the desired state.

Below is how to undo/revert a committed change with both ANKH and Tortoise.

ANKH

With solution open in Visual Studio, Right click context menu (this can be a Solution, Project, or any specific file) > View History > Select revision > context menu > Revert to this Revision.

ToirtoiseSVN

In file explorer right click on the file or folder (this could even be the top folder if you want to do a mass undo): Show Log to display a list of revisions, select a revision, then select Context MenuRevert to this revision. Then at the top folder level do Commit, and all of the items will be reverted.

Bellflower answered 8/8, 2018 at 17:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.