TFS: How to you Undo Checkout of Unmodified files in a batch file


We use a batch file to generate code, and it automatically checks out the generated files from Team Foundation Server (TFS) so that it can regenerate them. The majority of these files are not modified, but the generator does not know this ahead of time.

The "tfs undo" command undoes the checkout, but prompts if some have been modified (which we don't want to do). We also do not want to check in the generated files right away.

Is there a command (or series of commands) to undo checkout of all unmodified files without prompting the user?

Best Solution

Take a look on Undo Unchanged command of the Team Foundation Server Power Tools August 2011

c:\myProject> tfpt uu . /noget /recursive

Thanks Matt Florence for link update.

Thanks Ray Vega for actual syntax.