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

40,622

Solution 1

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.

Solution 2

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.

Solution 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.

Share:
40,622
Tahir Hassan
Author by

Tahir Hassan

A programmer who uses the .NET Framework.

Updated on April 30, 2020

Comments

  • Tahir Hassan
    Tahir Hassan almost 4 years

    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?

  • Nibnat
    Nibnat over 7 years
    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.
  • JB Nizet
    JB Nizet over 7 years
    @Nibnat you probably re-added the 2 when resolving the conflict.
  • praveena H M
    praveena H M over 2 years
    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).