Search code examples
visual-studiotfstfvc

TFS History of a deleted file


I have ran into a problem with history of a certain file on TFS. I need to find a file history in TFS so I could investigate why was it deleted, but we have hundreds of changesets so manual finding is out of question. Is there a way to find a certain file history in a specific TFS directory? I know almost nothing about it - I don't know when it was created, changed and deleted, but I know its directory and full filename. Is this possible at all?


Solution

  • From a Visual Studio commandline:

    tf history $/Project/Path/To/File.Extension /collection:https://yourserver:port/tfs/collection
    

    should give you the information you're after.

    Alternatively, turn on displaying of hidden files in the Source Control Explorer settings:

    enter image description here

    And then use the View History context menu item directly from the source control explorer.