Question

The link:

http://tortoisesvn.net/docs/nightly/TortoiseSVN_en/tsvn-howto-rollback.html

describes two ways of rolling back an SVN directory after a wrongful commit. What is the difference between the two options

Revert changes from this revision
Revert to this revision

As a test, I added a file, rolling back using "Revert changes from this revision" and did the same process for the "Revert to this revision", and there is no difference with the state of the SVN log.

Am I missing something?

Was it helpful?

Solution

Let's say you have these N sucessive commits: 1, 2, 3 and 4.

If you select the commit 2 and choose "Revert to this revision", your working copy will contain the changes brought by commits 1 and 2. Commits 3 and 4 will be "canceled".

If you select the commit 2 and choose "Revert changes from this revision", your working copy will contain the changes brought by commits 1, 3 and 4. Commit 2 will be "canceled", or rather, played in reverse on the top of commit 4: if a line was added, it will be removed. If a line was removed, it will be readded.

OTHER TIPS

For a single and latest commit, there is no difference.

The difference comes when you want to use a revision somewhere in the middle of your list of changes.

Revert to this revision will revert all commits from head upto this revision.
Revert changes from this revision will revert only the commit of that particular revision.

If you want your entire local source code to revert back to the way things were at some previous revision, choose "Revert to this revision." If instead you want to keep your local source up-to-date, but undo some change that was made several revisions ago, then you don't want your entire local source to go back, you just want to undo that one change you made a while back. "Revert changes from this revision" lets you do that.

Client side operations do not show up in the repository logs. You probably want to check at:

  • TortoiseSVN → SVN Check for modifications

... in order to see the differences between both actions.

After reviewing the local changes, you need to commit as usual.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top