tags:

views:

87

answers:

3

I need to get a previous version of a file in source control, using Team Foundation Server (TFS), . When I try to get a specific version based on change set the merge screen comes up. I do not want this, I just want to get the previous version and have it checked out. My current version of the file got corrupted and now I just want the previous version.

A: 

On the merge screen, you should be able to choose to overwrite your local copy with the server version. That sounds like what you want to do.

However, the merge screen should only show up if you have pending changes. If you undo your pending changes on the file, the Get Specific Version command shouldn't cause a merge.

bdukes
I need to rephrase what I am trying to do. I want similar functionality to VSS where I could look at history, pick a version and rollback to that verion (make the previous version the current verion).Thanks
bob
A: 

Hmm maybe I am doing something else wrong. I check the file out, then I do get specific version, enter the changeset number, I do not check either of the overwrite check boxes. I get the merge screen, I tell it to overwrite local copy. It does this, but then it undoes my check out and says I do not have the latest on my local computer. If I checkout at this point it ovewrites my previous version with the latest.

bob
+1  A: 

Ah, it sounds like you want to rollback (that is, remove some checkins from TFS' history). There is not a built-in way to do this with TFS. However, you can use the TFS Power Tools to accomplish this (there is a tfpt rollback command).

In practice, the rollback command just does what you're trying to do. To do it manually, get the version that you want (without checking out the file). Save that somewhere else, then check the file out (which will perform a "get latest" command). Then overwrite that version with the version that you saved elsewhere.

Alternatively, there's a setting in the TFS settings to "Get latest version of item on check out," which may be the cause of all of your problems. It's located in Tools->Options, under Source Control->Visual Studio Team Foundation Server. If that's checked for you, try unchecking it and seeing if it'll let you do what you're trying.

bdukes
Thanks, this is what I was looking for. It seems TFS did not really take into account that people might want to do rollbacks. I have about 30 files that I need to rollback, all in different folders. It is going to be a long day. Thanks again.
bob