Undo and Redo Global Actions

Tips Search

Undo and Redo Global Actions

  • Comments 4

Menu:  Edit -> Undo Last Global Action; Edit -> Redo Last Global Action
Command:  Edit.UndoLastGlobalAction; Edit.RedoLastGlobalAction
Versions:  2008,2010
Published:  2/23/2010
Code:  vstipEdit0020

 

Everyone knows about Undo and Redo but did you know there are Global versions of these actions on the Edit Menu?

image

 

By definition, global actions impact multiple files.  Global actions include renaming a class or namespace, performing a find-and-replace operation across a solution, refactoring a database, or any other action that changes multiple files.  You can apply the global undo and redo commands to actions in the current Visual Studio session, EVEN AFTER you close the solution that an action applies to.

  • I have lost days of works by undoing a global rename by accident. Why on earth does it undo all files to before the rename and then save them.

    This is so unproffessional and the warning is not sufficient.

    I just cant believe it.

  • @Stewart

    You can hit Redo Last Global...

  • Hi

    Like Stewart I also lost a lot of work due to this Global Undo. I had saved my work prior to doing this, but still I am not able to get to that point after redoing or undoing(Ctrl +Y or Ctrl +Z). The Global Redo button is also disabled. Please can anyone suggest how to get back my source code. I have the compiled exe of the code before global undo with me. If there is no other way in VS to Undo the Global Undo, then is there any way where I can utilise the compiled .exe to get back my code.

  • Shashank,

    If your works was saved you might be able to retrieve a prior version of the file--assuming you were set up for keeping prior versions.  There are ways to reverse engineer assemblies but they tend to have varying levels of success.  With regard to the Global Undo as a feature, it comes with numerous safeguards to make sure you don't accidentally use it.  Most notably it has no keyboard shortcut assigned by default AND it gives you a warning message when appropriate for changes that can't be recovered.  

    There is a really great summary presented on a discussion thread found here:

    social.msdn.microsoft.com/.../e87e60b1-c3c8-47fd-9c27-e3747d86f75f

    Z

Page 1 of 1 (4 items)
Leave a Comment
  • Please add 8 and 5 and type the answer here:
  • Post