Share via


Undo and Redo Global Actions

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.

Comments

  • Anonymous
    March 10, 2011
    The comment has been removed

  • Anonymous
    June 25, 2011
    @Stewart You can hit Redo Last Global...

  • Anonymous
    January 14, 2013
    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.

  • Anonymous
    January 15, 2013
    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