Search code examples
c#visual-studiotfsversionteam-explorer

TFS Replace Everything


I JUST want to get the latest version of a C# project on TFS and replace everything, it doesn't matter what I did on the code.

I'd Like to delete all the stuff and restart again as the way it is on the server.

Other solutions even simplier ARE NOT interesting for me.

JUST THIS ONE.

Thanks since now.


Solution

  • In my answer i will discuss 2 ways to get rid of the changes you made and reset back to what is in the code repo. First is the way to reset all files at once. The second method is how to do 1 single file if that is all that is needed.

    METHOD 1, ALL FILES AT ONCE:

    Click the Home button on the Team Explorer and see this screen:

    enter image description here

    Then click Branches to see this screen:

    enter image description here

    Then right-click the branch you want to revert your local code to and select Reset and then Delete Changes (--hard):

    enter image description here



    METHOD 2, Single file at a time:

    Now you may want to just revert a single file and this is done by doing the following:

    Click Home button on your Team Explorer and see this page:

    enter image description here

    Then click Changes and see this screen:

    enter image description here

    Then right-click any of the files you have listed there and select Undo Changes...