Rolling back to a deleted version of a file

If you are having a problem using Fortress, post a message here.

Moderator: SourceGear

Post Reply
rwmnau
Posts: 11
Joined: Mon May 23, 2005 2:34 pm

Rolling back to a deleted version of a file

Post by rwmnau » Mon Jun 29, 2009 5:10 pm

I've run into a problem where I have difficulty accessing the previous version of a file. To recreate the situation, take these steps:

1. Version a file a few times (so that it has history)
2. Delete the file from Fortress
3. Add a new file to your project with the same name as the previous one
4. Check in the new file

While I can "Rollback" the files by doing a "Get" on the pre-delete version, and then checking that in on top of the "blank" version, I still don't have access to my file history (Right clicking on the file and selecting "History" only gives me the checkin of my replacement file). I'd like a way to roll back to the previous version while preserving access to my previous history.

Is there a way to restore the deleted version of the file, along with its history? If there was a "Rollback for folders" feature, I could do this, but according to http://support.sourcegear.com/viewtopic ... 30&t=11231, this feature isn't currently in Fortress.

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Re: Rolling back to a deleted version of a file

Post by lbauer » Tue Jun 30, 2009 7:51 am

When you delete a file then add a file with the same name, Vault gives it a new item ID and doesn't consider it related at all to the deleted file, even though it has the same name.

You can restore a deleted file by right clicking on the parent folder, and selecting Properties->Deleted Items->Undelete. If you have an item with the same name already in the folder, delete or rename it first.

Now you will have the undeleted file plus its history. To rollback the file, right click on the file, select Show History. Select the version you want to rollback to, right click, and choose Rollback. We have rollback for files, but not for folders.

Is there a reason you are deleting a file, then adding a new one with the same name? You could just checkout the file, replaced the local copy with a file with the contents you want, and check that in.
Linda Bauer
SourceGear
Technical Support Manager

rwmnau
Posts: 11
Joined: Mon May 23, 2005 2:34 pm

Re: Rolling back to a deleted version of a file

Post by rwmnau » Tue Jun 30, 2009 8:28 am

Ah - deleting the new version, and then undeleting the old one, was exactly what I needed - that restored the previous version of the files with history intact.

The new version of the files wasn't intentional - I had deleted the files in one copy of my project, and then I think I just added them back to the project from another working copy, instead of going into Fortress and undeleting them there. Lesson learned - thanks again for the help!

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Re: Rolling back to a deleted version of a file

Post by lbauer » Tue Jun 30, 2009 10:56 am

You're welcome. :-)
Linda Bauer
SourceGear
Technical Support Manager

Post Reply