It's all about the answers!

Ask a question

How do I recover a deleted file in Visual Studio?


Martin McAuley (1721533) | asked Dec 12 '14, 10:52 a.m.
In Visual Studio, a solution is loaded, a file is changed and checked in e.g. Form1.cs, change is then undone using the 'undo' command, outgoing change set is now empty - how do I recover the deleted contents? In general how do I see the check-in history of the current active change set, showing check-in's undo's etc?

Comments
Lily Wang commented Dec 15 '14, 4:10 a.m.

I don't think it's possible to restore the change deleted by "scm undo".

2 answers



permanent link
Prabodh Mairh (3812) | answered Dec 16 '14, 4:24 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
Check-in history of a change set works only in the context of history on a file. In your use case, although the change set maintains the check-in history of the file state that was deleted by "scm undo", you are not able to view it since the change set no longer appears in the history of the file. 
If you make any change to the same file and check-in again to the same change set, it will start appearing in the file's history, and then you can also view the content that was deleted earlier in the check-in history of the change set. 

Comments
Martin McAuley commented Dec 16 '14, 4:34 a.m.

Thanks for the update - so if a file is undone and the changeset completed e.g. delivered, and the user subsequently wants to restore the undo they cannot even though the undone change is in RTC?


permanent link
Geoffrey Clemm (30.1k33035) | answered Dec 19 '14, 12:22 p.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
In order to see an "undone" change in the history view of a file:
- In the history view:
  - click the View-menu tool button (the downward triangle on the right side of the tool button bar that is at the top of the history view), and select "Preferences" (it really should be "Preferences ..." :-).   Then select the bottom radio button for "Include change sets with matching intermediate states when showing all in repository".
  - click the "Show all in repository" tool button.

Note: This is for changes that were "undone" from a change set.   It will not show you unresolved changes in the sandbox that were undone, because those changes never made it into a change set.
Note: This is in the Eclipse client ... someone needs to verify this is also available in the Visual Studio client.

Comments
Prabodh Mairh commented Dec 23 '14, 1:29 a.m.
FORUM MODERATOR / JAZZ DEVELOPER

This preference option is not available in the Visual Studio client. I have opened an enhancement request for the same.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.