Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get my changes back after clicking "Undo pending changes..." in Visual Studio 2013 and TFS

Tags:

Using Visual Studio 2013 and TFS I did a lot of work before checking in. Then I accidentally clicked undo pending changes... thinking it would only apply to one of the projects in my solution. Unfortunately it was applied to all projects. How can I get my changes back?

This question has been asked before link. One person suggested using Reflector to copy the dll. I downloaded Reflector, but I'm unsure how to use it. How would I use Reflector to get my changes back.

like image 514
navig8tr Avatar asked Jul 21 '14 16:07

navig8tr


2 Answers

Just for your help. As per stackoverflow's questions link shared. He is trying to say that if you have not build your project. You can open last built dll in Reflector and see the code of the files and recover the code.

You can use any took like Reflector or dotpeek from JetBrains.

Visit this link to know more about dotpeek

But if you have build your project after performing Undo Pending changes then as per my knowledge it is impossible to get the code.

like image 147
Dnyanesh Avatar answered Dec 07 '22 23:12

Dnyanesh


Unbelievable! After giving up and rewriting all of the code I lost, I was able to recover the files. After pressing "Undo pending changes" I never built the solution again. Then, I closed the solution, copied the entire workspace and saved it under a different name. Next, I reopened the original solution. I then used "Add existing item" from the original locations of the files I lost. Then, (and here's the cool part) I navigated to the copied workspace and found the lost files in-tact and in their original locations. Great! I only wish I did this before I rewrote my code!

For me, this solution was found purely by happenstance, but I hope someone else can use this information in the future. Please note that I never built the solution after I undid the changes so that may be the reason why the files were still in their original locations but not visible in the solution itself.

like image 44
navig8tr Avatar answered Dec 08 '22 00:12

navig8tr