Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 948
Tahir Hassan Avatar asked Apr 04 '14 10:04

Tahir Hassan


People also ask

What is revert in TortoiseSVN?

If you want to undo all changes you made in a file since the last update you need to select the file, right click to pop up the context menu and then select the command TortoiseSVN → Revert A dialog will pop up showing you the files that you've changed and can revert.

What does update to revision do in svn?

svn update brings changes from the repository into your working copy. If no revision is given, it brings your working copy up-to-date with the HEAD revision. Otherwise, it synchronizes the working copy to the revision given by the --revision option.


1 Answers

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.

like image 184
JB Nizet Avatar answered Oct 12 '22 18:10

JB Nizet