By default, you can use the 'Undo' button up to 20 times in a row in Microsoft Visio. After that, you're out of luck. If you're like me though, and enjoy being able to time travel a bit more, you're going to want to change that setting to the highest number possible.
To change the setting, go to the 'File' tab, and then click 'Options'. In the 'Visio Options' window that will appear, choose 'Advanced' from the menu on the left. Now, in the first section, 'Editing Options', the 11th option from the top is 'Maximum number of undos'. Go ahead and change the number in the listbox to any number that is equal to or less than 99.
You could also reduce the number of times that you can undo actions, but why would you want to do that? The only real advantage is that it reduces the amount of extra data sitting in memory... but that shouldn't be too much of an issue unless you're using an ancient computer.
In any case, it's up to you - and you're free to change it any time you feel like it. Happy drawing!