Retain Variable in Ram through Reset

Not in SRAM.
Can put in EEPROM. Need to recognize power is going down, and have some millliSeconds of power left to complete the EEPROM write.

If have an RTC, like DS1307, there is battery backed SRAM to hold it.