You don't want this to happen in the first place as that would trigger the outside bell hold off when mains and battery are missing.
Programming should be stored in non-volatile memory but it can be possible for memory to be lost on older kit if the system is faulty.