TortoiseSVN - "revert changes from this revision" vs "revert to this revision"

Tahir Hassan picture Tahir Hassan · Apr 4, 2014 · Viewed 36.7k times · Source

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?

Answer

JB Nizet picture JB Nizet · Apr 4, 2014

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.