When you work with a document, it is possible to undo last several operations and then redo them if needed.
Continuously typing a chain of symbols is considered as one operation until you interrupt it by some input event, for example by moving the cursor or executing a command.
If you fail to undo all of your operations, it is because the maximum number of operations to undo/redo is limited. You can change the maximum number of the most recent operations to undo/redo.