Retain Variable in Ram through Reset

You can also use a FRAM memory chip. No battery needed.
3.3V, 5V, SPI & I2C versions. No more thru hole parts tho, will need an SMD adapter. SOIC packages are not too bad to hand solder.