13

On occasion, I'll end up checking in a file to our TFS db that I didn't intend to. Reverting to the prior version is quite tedious with my current approach.

If there a fast way to revert a file to a prior version in TFS? I'm open to command line, powertool, or UI approaches.

Daniel Mann
  • 49,975
  • 11
  • 87
  • 105
Scott Weinstein
  • 18,222
  • 12
  • 71
  • 112

2 Answers2

9

You need to install the power tools:

http://msdn.microsoft.com/en-us/tfs2008/bb980963.aspx

  1. For VS2013 - Microsoft Visual Studio Team Foundation Server 2013 Power Tools
  2. For VS2015 - Microsoft Visual Studio Team Foundation Server 2015 Power Tools
Aamol
  • 984
  • 1
  • 12
  • 20
Iain Holder
  • 13,731
  • 10
  • 61
  • 84
  • I haven't used TFS since just after answering this, but I seem to remember that it was pretty obvious after install. I think it was a right click option. – Iain Holder Jan 12 '11 at 14:59
  • 1
    You can see a more detailed answer to a similar question at http://stackoverflow.com/a/7124274/62278 – Brian Hinchey Oct 30 '12 at 21:43
9

If you don't want to use the command line, or install the tools, you can also do it in an old-school way:

http://msmvps.com/blogs/vstsblog/archive/2009/01/10/how-to-revert-changes-checked-into-tfs-version-control.aspx

Peter Walke
  • 2,447
  • 5
  • 32
  • 49
  • This still works in VS2017, though some menu commands have shuffled around ("Get Specific Version" is now in "Advanced" sub-menu for example). Main difference is TFS may attempt to Auto-Resolve on check in, tossing your reversion. To disable Auto-Resolve before you check in: Tools -> Options -> Source Control -> Visual Studio Team Foundation Server -> Uncheck "Attempt to automatically resolve conflicts when they are generated" [From here](https://stackoverflow.com/questions/1663550/is-it-possible-to-disable-the-auto-merge-option-in-visual-studio-team-system-200) – AceJordin Feb 22 '19 at 15:00