TortoiseSVN - "revert changes from this revision" vs "revert to this revision"
Asked Answered
O

4

52

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?

Outsell answered 4/4, 2014 at 10:16 Comment(0)
G
93

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.

Gradin answered 4/4, 2014 at 10:47 Comment(3)
I still don't understand how this option work, if I have a empty file and I write 1 into this file, commit and then write 2 and commit, and then write 3 and then commit. Now I open show log dialog and chose second commit and revert changes from this revision, after solved conflict, the file now is 123, should't 2 deleted? it should be 13, but not 123.Nightwalker
@Nightwalker you probably re-added the 2 when resolving the conflict.Gradin
To make people understand. Simple way. Revert to this revision : 1,2,3,4 commits. If you select the 2 commit and click on (revert to this revision) will revert 4 and 3 commits. 2 and 1 commit will not revert. Note(You should commit your reverted changes). Revert changes from this revision : 1,2,3,4 commits. if you select the 2 commit and click on (revert changes from this revision) will revert 2 commits. 1,3 and 4 commit will not revert. Note(You should commit your reverted changes).Lifeblood
C
18

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.

Copeland answered 4/4, 2014 at 13:51 Comment(0)
S
3

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.

Sharper answered 15/10, 2015 at 18:29 Comment(0)
C
0

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.

Cordovan answered 4/4, 2014 at 10:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.