Thanks for the answer, but ...

if I start m5burner, select UIFlow_Fire, configure WLAN and USB-Driver and burn ... I only get the API-Key message, the setup menu and the app menu (temp.py) on the display ... nothing else to do.

I can now start UIFlow and program the device
with blockly (-> modules -> bala2, there are some commands for the encoder motors ... but not for selfbalancing!)
or with micro python (but there is no list of the available commands for selfbalancing)

now back to m5burner:
I also tried the upper menu
– Serial Monitor: successfully connects to the device
– Firmware Exporter: exports an esp32fw.bin file?
– Refresh Firmwares: nothing happens?!

After m5burner, UIFlow Blockly, UIFlow Micropython I finally tried Arduino. There is indeed a file FactoryTest (Examples -> M5Stack -> Basic: FactoryTest) and it works but it' s not the program for selfbalancing then I tried bala2.ino (Examples -> M5Stack -> Modules: BALA2) ... and I got the error message above.

No matter which way I choose I don't succeed in restoring the original (delivery-)code with the self balancing car that's what I mean with restoring the firmware.

If you have a new idea tell me please.

Thanks

wzemann