undo invalid replacement