Code Renaissance is about building great teams and great software. By exploring best practices, team interactions, design, testing and related skills Code Renaissance strives to help you create the team and codebase that you've always wanted.

How to Revert/Rollback a file using Tortoise SVN

It appears that a lot of you are finding my previous post about Revision Control Using Tortoise SVN when looking for how to Revert or Rollback a file using Tortoise SVN (at least per keywords in Google analytics). So I thought I'd throw this out right quick to help because I didn't cover it there.

As you probably know Tortoise SVN integrates into the explorer so that right clicking on a file lets you drill down into a ton of menu options. Not all functionality is deployed through the menu though; a lot is done through the Log. To roll back a file, start by right clicking on it and selecting Show Log.

Once you have the log open, right click on the desired version of your file. Your options will let you view this version or compare to your working copy (I highly recommend configuring Tortoise SVN to work with Beyond Compare if you have it; Settings/External Programs/Diff Viewer). The menu item that you want is "Revert to this Revision".

Upon selecting this Tortoise SVN will notify you that it is doing a reverse merge into your working copy; click yes. You will note that your file has been reverted/rolled-back and is showing as changed (red dot on icon). Commit the file (or make changes and commit) and you're done.

Hope this helps.

2 - What do you think?:

Anonymous said...

Thanks. But does a revert also override your current changes locally on that file...and you lose your local changes?

DH said...

Revert pulls a version local. If your local changes are important you could always check in the changes before you revert.