The latest volume of MagPi is out and in addition to a lot of information about the RPi 4, there is a fascinating article about how to set up a recovery partition on your SD card and a script to restore the machine.
Many of us have used a Windows machine where there is a recovery partition on the hard drive. If you run into real trouble you can “factory reset” your hard drive by using that partition to restore your machine to what it looked like when you first got it. This tutorial (starting on page 48) shows how to set up something similar on an RPi. To kick off the recovery you short (with a resistor) two of the RPi’s pins (could probably be wired with a button) and it will recover your SD card to what ever state it was in with the image stored in the recovery partition.
I wonder if this is something that could be incorporated into openHABian. Obviously, with warnings that this will erase everything.
But even if it isn’t, this could be an easier way for those of us who have RPis scattered about as sensors to quickly recover when something goes bad short of the SD card wearing out, in which case replacing the card is the only thing to do.