I was reading (wikipedia) about how the rope data structure might be suitable for a text editor. Within the article it mentions "If only nondestructive versions of operations are used, rope is a persistent data structure. For the text editing program example, this leads to an easy support for multiple undo levels." I don't understand how the undo works in this.
For example, let's say i had an existing rope with the left leaf as "hello" and the right leaf as "world". The parent (root) would have the value 5 (length of hello). Then, if i were to delete "world" i am just left with the root and left (hello) node. Now, if i wanted to "undo" the delete, haven't I already discarded the "world" node? Traditionally "undo" is done by placing things on a stack, but in this case I don't understand if using a stack what to put on it or how to do the undo in general.