In Visual Studio remove local files when undo pending changes
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开发者_JS百科 undone local files should also be removed?
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.
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.
精彩评论