Anyone know of a brand of bike computer that when changing the battery the wheel size code and accumulated mileage will not be lost?
Change batteries on a schedule, not just when they fail.
Keep a record of the wheel diameter entry, write it in the margin of the owner's installation manual.
Just prior to removing the current battery, scroll through and record the odometer readings of interest.
Many (most?) bike computers allow you to enter an initial value for odometer. Transfer your old numbers there. Check your owner's manual.