I am using VS2015 and TFS. By mistake I have clicked on Promote Candidate Changes for all the excluded files... (.xml,.nupkg, ecc...)
Now, every time I reopen the Solution and go to TFS "pending changes" all these files are listed in the Included Changes.
I can click individually on the folders and choose "Exclude" but that works only for this time... When I close/reopen VS (or the solution) all the files are back on the Included Changes...
How can I restore/undo the Promote Candidate Changes?
To undo all changes you have made in your solution or a code project, open the context menu, and then choose Undo Pending Change. In the Undo Pending Changes dialog box, make sure the changes you want to undo are selected, and then choose Undo Changes.
When you want to discard any modified files/folders, right click on them under Solution Explorer. From the context menu, select Source Control | Undo Pending Changes..., as shown in the following screenshot: Make sure to double confirm whether you really want to undo the file/folder.
CTRL + [, P to get pending changes and if the file has been modified it will be in the list.
In Microsoft Visual Studio, click Tools > Options. Go to Source Control > Jazz Source Control > Check-in Policies. Select the Auto check-in local changes check box and click OK.
So the only solution is to undo pending changes on the related computer and continue with the server version. Here is how we will manage this task using TFS Command Line Utility TF Undo command.
In Solution Explorer, the Pending Changes Window, or Source Control Explorer, select one or more items, open their context menu and choose Undo or Undo Pending Changes. To undo all changes you have made in your solution or a code project, open the context menu, and then choose Undo Pending Change.
You can use the Pending Changes page (Keyboard: Ctrl + 0, P) in the team explorer to manage your work. You can undock the Pending Changes page from the team explorer and open it in a new window.
In GIT this is fairly trivial, in TFS however… To move changes between 2 branches, you have to ensure: The changes you want to migrate are shelved on the source branch. There are no pending changes in the workspace – This was rather annoying but a limitation of the tooling.
You could undo the promoting of files, just click "Undo..." in context menu. It will add you files to "Detected adds" list again.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With