Undo history rewritten from scratch with nested histories