rope data structure - undo operation
The approach is to build a fully persistent version of the rope data structure.  This then lets you keep a pointer to each version of the data structure: you have a pointer to version 1 ("hello world") and version 2 ("hello").  To undo the last operation, you just start working from version 1 rather than version 2.  In particular, yes, you can store these pointers in a stack data structure. The point is that each modification creates what is effectively a new copy of the data structure, without modifying the old version.  Of course, actually making an entire copy would be inefficient, so what the data structure does is share the parts of the tree that are unchanged.

For details on how to make a persistent version of the data structure, see What classes of data structures can be made persistent?.  See also Array-like immutable (persistent) data structure implementation with fast indexing, append, prepend, iteration.