3

In Visual Studio if I add a few files to a project but then decide to undo my pending changes the files are removed from the project but remain on my hard drive. This isn't terrible but is annoying. In Visual Studio is there a way to specify that when a change is undone local files should also be removed?

ahsteele
  • 26,243
  • 28
  • 134
  • 248

2 Answers2

2

I do not know of any way to do this within Visual Studio, however, the Team Foundation Server Power Tools command line utility (TFPT.exe) has a "/scorch" command that you can run that will sync your file system (based on workspaces) back up with version control. So, for example, any items that you've deleted from version control that still remain on your hard drive will be removed.

Jeff Bramwell
  • 990
  • 8
  • 16
-1

Pretty old question but hopefully this will help out someone out if the accepted answer using scorch doesn't work out.

I do not know of any supported way to recover files that have their changes removed via "Undo Changes".

The best I can think of is to keep an extension like File History installed so you can still go back and see the state — and diff against current — of files and pick and choose what changes to keep from one save to another.

If you don't have an extension such as File History installed to help then I'd say the next best shot; and a long shot is to try file recovery. Check for Windows File History and see if they can be recovered from there. Or maybe a file history restore might work. ...like I said, this is a long shot and I have not tested it.

Rockin4Life33
  • 2,240
  • 1
  • 31
  • 29
  • @Thick_propheT, no it doesn't have anything to do with _reco_ a Brazilian percussion instrument. Thanks for the downvote! Looks like someone doesn't have a clue what they're doing and not looking for help, but someone to provide and perform the solution for them. – Rockin4Life33 Feb 11 '21 at 01:07
  • The question doesn't have anything to do with recovering files. It’s kind of the opposite actually. The question is asking for a way to remove added files when you undo pending changes. – Thick_propheT Feb 22 '21 at 23:57