For those of us that have been using Mac OS X for a while, reverting a mistake with ⌘Z is natural. However, the popularity of Apple's iOS devices have brought a large new group of users to the Mac. In the most recent version of Mac OS X, 10.7 "Lion", Apple has addressed many of the concerns of these users with a few features. Launchpad fixes the unintuitiveness of an automatically alphabetized grid of applications (provided by Stacks) by allowing the user to arrange applications in any order. Mission Control removes the confusing grid that previously plagued Spaces. Where a user with four spaces could previously end up on any of the other three with a single keystroke, he or she is now presented with a much less confusing choice between one or two.
However, Apple missed an obvious location for improvement. Although Lion provides many touch gestures that can be activated with the trackpad, it completely ignores the potential ability to use the laptop itself as a gesture device. When both commands and text input are mapped to the keyboard, as is currently the case, the keyboard loses the design focus of being a single-purpose device. When the user has to take additional time to switch to a different input method in order to perform commands, his or her mind will be entirely focused on the task at hand by the time the gesture is performed.
Therefore, I have fixed a small portion of this mistake, by implementing the "Shake to Undo" gesture from iOS. Once the application is running, simply shake your laptop to activate undo. To prevent accidental activation of the undo gesture, there is an optional confirmation overlay, similar in style to the undo overlay on iOS.
This is all made possible by SMSLib, an open source library for accessing the sudden motion sensor in MacBooks.
If you feel that the current implementation is lacking or is otherwise not feature complete, please fork the project on Github.