You could :set hidden
. This means that the buffer of the old file will only be hidden when you switch to the new file. When you switch back, you still have your undo history.
You could :set hidden
. This means that the buffer of the old file will only be hidden when you switch to the new file. When you switch back, you still have your undo history.