The Ramblings of Two Microsoft .NET Developers, TFS, and Visual Studio ALM Guys --- "Yes, we are both named Ed."

Rollback or Undo a Changeset in TFS 2010 Version Control



Updated – 8/19/2011 – New Rollback Features Available in the UI with TFS 2010 Power Tools (See Below for More Details)

One of the new features for TFS 2010 Version Control is the ability to rollback or undo a changeset or check-in inside the product and see it as a new pending change type (and new change type in the history) inside Team Explorer. This feature has been available in TFS 2008 but you had to use the TFS Power Tools. The only gotcha for the TFS 2010 implementation is that you have to use the command-line application tf.exe to actually perform the rollback operation. More information about the tool is available here in the MSDN Library: http://msdn.microsoft.com/en-us/library/dd380776(VS.100).aspx

The syntax is:

tf rollback /changeset:changesetfrom~changesetto [itemspec] [/recursive]
[/lock:none|checkin|checkout] [/version:versionspec]
[/keepmergehistory] [/noprompt] [/login:username,[password]]

tf rollback /toversion:versionspec itemspec [/recursive]
[/lock:none|checkin|checkout] [/version:versionspec]
[/keepmergehistory] [/noprompt] [/login:username,[password]]

Versionspec:
Date/Time D"any .Net Framework-supported format"
or any of the date formats of the local machine
Changeset number Cnnnnnn
Label Llabelname
Latest version T
Workspace Wworkspacename;workspaceowner

image

image

Rollback Available in the UI Now

If you have the August 2011 or later version of the TFS 2010 Power Tools installed, you now have the ability to fire off a rollback straight from Team Explorer without having to use the command-line approach.  The main way would be to fire it off from the Source Control Explorer window.

image

However, you can start the rollback process from the Changeset History window as well.

image

 

Ed Blankenship



Thursday, May 13, 2010 3:01:19 AM (Pacific Daylight Time, UTC-07:00)
A helpful article, thanks.

It is a real shame though that we can't just rollback from the GUI instead fo having to fiddle about with the command line. That would make the use experience so much better.
M Nield
Friday, August 19, 2011 8:44:05 AM (Pacific Daylight Time, UTC-07:00)
I agree - now we have the ability to perform rollback in the UI using the latest release of the TFS 2010 Power Tools.
Friday, March 23, 2012 10:02:38 AM (Pacific Standard Time, UTC-08:00)
Thanks! Why can't Microsoft write usable help?
Tuesday, April 03, 2012 1:27:09 PM (Pacific Daylight Time, UTC-07:00)
how do you get to the changeset history window?
Don't assume everybody knows everything you do
Huge
Friday, May 04, 2012 2:49:23 PM (Pacific Daylight Time, UTC-07:00)
Huge nailed it.. how do you get to that screen?
Confused User
Monday, July 16, 2012 8:52:16 AM (Pacific Daylight Time, UTC-07:00)
Huge,

I know you asked the question awhile ago, but don't assume a response from the guy if you can't ask without being snarly about it...

That being said, to get the "changeset history window", choose/highlight a branch/directory (a branch would make more sense in this case since you'd want to see all the changesets included in the entire branch), right-mouse click, choose "View History". Once you do so, you can highlight a changeset in the changeset history window, right-mouse click the changeset and then choose "Rollback Entire Changeset" if you so wish...

Have a nice day...
DN
Monday, March 04, 2013 7:15:44 AM (Pacific Standard Time, UTC-08:00)
Ed- you're awesome. Nice, concise, etc. If you ever tire of what you're doing- and especially if you know a whole team of folks who can explain things as you do- you'll take the documentation world by storm. (Guess you already ARE- it's just that the doc world is "Google" now, instead of on paper.)

Again, NICE JOB, and thanks- huge time saver.
Jim Peak
Name
E-mail
(will show your gravatar icon)
Home page

Comment (Some html is allowed: a@href@title, b, blockquote@cite, em, i, strike, strong, sub, sup, u) where the @ means "attribute." For example, you can use <a href="" title=""> or <blockquote cite="Scott">.  

[Captcha]Enter the code shown (prevents robots):

Live Comment Preview