There are cases of the total mileage resetting after the power was disconnected or software work was done. For other owners the total mileage was kept. It is a defect in individual cases, not normal behaviour that you should test by deliberately removing a battery terminal.
What to distinguish from a reset
Check whether the total odometer or the trip meter is displayed, and whether kilometres have switched to miles. The clock, language, units, engine hours and total mileage are different parameters; a reset of one does not prove the others were lost.
In some cases the language and settings changed along with the readings. Some owners link this to an interrupted update, but the exact cause of each case has not been established.
What to keep
Before any software work, take photos of the total mileage, the dash versions and the service history. If the reset has already happened, gather old photos, work orders, dates and the last reliable reading. Don't try to "ride off the missing distance" instead of going to a workshop.
Cases include recovery with workshop equipment and replacement of the board or dash. Whether the value can be transferred and what proof is needed should be checked with the workshop. A new dash does not necessarily receive the old history automatically.
Servicing and selling
Keep a continuous record of the actual total mileage. The service plan does not start from zero after a screen replacement. When selling, disclose the replacement or reset and hand over the proof: a low number on the dash does not describe the engine's condition by itself.
When buying a used bike, check the history rather than removing a terminal as an experiment. Before an update, use the package for your series and do not interrupt the installation stages, even if the screen goes dark for a while.