Is it possible to delete a changeset?


  • I'm using TFS2010 and I'm coming from a ClearCase environment. In ClearCase I could delete a specific node on an element. Is it possible to do the same in TFS? I have found the rollback command, but that doesn't remove a version of a file, just copies an older one to become the latest.



    Monday, May 30, 2011 1:25 PM


All replies

  • You can use tf destroy from the command line, maybe with /keephistory and/or /stopat switches. But keep in mind that it cannot be undone:



    Hope it helps...

    Best regards


    Monday, May 30, 2011 5:08 PM
  • Not sure if I'm using it correctly as I can't get the specified changeset to be deleted.

    If I have the following changesets on a file:





    I then realize 748 is a complete mistake, how can I remove that changeset from the files history. In ClearCase I could do rmver, but not sure how to do this with the destroy command.

    I tried: tf destroy /keephistory $/myproject/mydir/myfile.ext;C748 /stopat:C735

    But that didn't do anything.




    Monday, May 30, 2011 5:46 PM
  • Sorry, I didn't get it right the first time; what I told you would destroy the old history for an item, but not an specific changeset.

    It's not possible (as far as I know) to remove a file from a changeset, or to remove an entire changeset from TFS. The closest option should be the rollback command that you've already tried.




    Monday, May 30, 2011 10:33 PM
  • Hello Anthony,

    Thanks for your post.

    For your issue I appreciate Jose’s great opinion. It is impossible for you to delete changesets from TFS Server. You should use the tf rollback command to roll back the effects of one or more changesets.

    Please refer to this article for further information about tf rollback command:


    Vicky Song [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, May 31, 2011 5:38 AM
  • What is the command to delete a changeset? There are times when this will be necessary. It is not my preferred action, but does need to be done once in a while.




    Tuesday, May 31, 2011 3:10 PM
  • Hi Anthony, as Vicky and me stated above, it's not possible to delete an specific changeset in TFS, so there is not any command capable of doing that. The closest options that you have is to destroy an item or part of its history (tf destroy), or to rollback the item to an specific changeset (tf rollback). But you can't remove an specific changeset.


    Best regards


    Tuesday, May 31, 2011 5:53 PM
  • Sorry, my mistake. I read "possible" instead of "impossible" in Vicki's post. Thanks.




    Tuesday, May 31, 2011 6:03 PM