Visual Studio global undo/redo
-
Friday, July 06, 2012 3:55 AM
While using the undo command (CTRL-Z) in Visual Studio 2010 Express Edition, I was presented with a pop-up window that I immediately assumed to be an undo confirmation nag. Turns out it was, but not for a typical undo. The program executed a "global undo", which reverted my files back to hours ago, destroying my work, and then saving over them. This is quite possibly the most terrible "feature" I've ever ran into in a piece of software. A google search has yielded that there may be a "global redo" somewhere, but I have yet to find it.
Is there any way to get my files restored? And further, is there a way to permanently disable this garbage functionality?
- Edited by Demon9ne Friday, July 06, 2012 3:56 AM
- Moved by Lisa ZhuMicrosoft Contingent Staff, Moderator Wednesday, July 11, 2012 9:53 AM vs editor related question (From:Visual C# General)
- Moved by Min ZhuMicrosoft Contingent Staff, Moderator Thursday, July 12, 2012 5:29 AM move to C# IDE as requested by Lisa Zhu (From:Visual Studio Editor)
All Replies
-
Friday, July 06, 2012 5:51 AM
I think for any action that's undone by Ctrl-Z, you can redo it by ReDo command (Ctrl-Y).
As to disable this function... In "Professional" edition you can use "Tools" -> "Options" -> Environment" -> "KeyBoard", then select "Edit.Undo" from the command listing and click the "Remove" button to remove the shourtcut association. See if you can find similar button in Express edition.
-
Wednesday, July 11, 2012 9:51 AMModerator
Hi DerekM07 ,
This is not problem about C# , so I move it to the related forums .
Thanks for your support and understanding .
Regards ,
Lisa Zhu [MSFT]
MSDN Community Support | Feedback to us
- Edited by Lisa ZhuMicrosoft Contingent Staff, Moderator Wednesday, July 11, 2012 9:52 AM
-
Thursday, July 12, 2012 5:44 AMModerator
Hi DerekM07 ,
I am sorry , I just been told that the Visual Studio Editor Forum has been Retired , so I ask other engineer to move it back to C# IDE .
I will be working with you on this problem. And now , I want to know , with cheong00's suggestion , have you solved the problem ?
Regards ,
Lisa Zhu [MSFT]
MSDN Community Support | Feedback to us
-
Thursday, July 12, 2012 4:11 PMModerator
Global Undo/Redo cannot be disabled. The actual undo/redo functionality is implemented by the various packages installed as part of VS. One of those packages is responsible for undoing file changes. It is up to the package to decide what commands can be undone and redone. I understand that you're upset about losing work but the feature isn't garbage because it is doing exactly what you'd want it to do.
The "nag" screen you mentioned is designed to let you know that you are making a major undo change that might not be recoverable. I don't really understand what more VS could do to warn you about the pending damage you may be doing. It is no different than having a delete confirmation dialog. If you didn't read the message and you confirmed you wanted to do it then VS really has done all it can do. Disabling file change undo doesn't make much sense because then you couldn't undo some very common changes. The whole purpose of a global undo is to identify a higher level of "undo" ramifications.
What I don't understand is why you can't just Redo to apply the changes back? There are some sets of changes that can't be redone - such as recreating a file that was deleted but file changes themselves can be redone. But for more code editing the redo should work just fine. Given your scenario I suspect the follow steps occurred:
- Open a file for editing (undo buffer is created)
- Made lots of changes to file (each change results in an undo entry)
- Undid the changes back to the version that was initially (empties the undo buffer)
At this point the redo can start replaying the undo buffer to put things back. But there are several things that you can do that will cause the undo buffer to be lost such as closing and reopening the file. I feel your pain about losing data but it really just goes back to some common dev processes that you should always be following:
- Save changes when you get to a good stopping point. Since files are saved at every build this shouldn't be a problem because rarely should you write code for hours without at least some build/test cycles.
- Use source control to check in changes periodically - especially after a test cycle confirms changes.
- Do work in small chuncks. If you're using TFS or equivalent then a small chunk is generally a task item.
- When doing destructive operations such as undo/redo be sure to read any messages that pops up. VS is really good about warning you about things that might not be recoverable. It doesn't bother warning you about things that can be undone (hence you won't get messages about most undos).
- Marked As Answer by Lisa ZhuMicrosoft Contingent Staff, Moderator Tuesday, July 17, 2012 2:35 AM

