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?



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 (4)

  1. Stewart says:

    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.

  2. You can just redo it says:


    You can hit Redo Last Global…

  3. Shashank says:


    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.

  4. zainnab says:


    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:



Skip to main content