In base, you can mark entities with connected wires and let regular bots do the work. After that, an Undo would restore the wire connections
But, if you interfere manually, and deconstruct/mine some of the marked entities by hand, then undo won't restore the wires. I guess, its intended, that wires get cut, when one side is deconstructed manually.
When autobuild deconstructs something, it simulates the player deconstruct/mine something, so it has this same behavior, unfortunately.
I'm not sure, if it's possible to simulate the behavior of a bot deconstructing
I think, the best bet is do use Cut instead of Deconstruct, so you might have the blueprint saved, in case something is missing on an Undo