As of ICS, there is no way to undo typing. This is a feature request that Google has ignored. If this is a feature you want, please go here and "Star" the topic.
http://code.google.com/p/android/issues/detail?id=6458&q=undo&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars