Arduino EEPROM retains old data after flashing with a new program
Flash isn't EEPROM. When you reprogram the flash it doesn't touch the EEPROM.

It's controlled by the -U... flag to avrdude:

avrdude ... -Uflash:w:&lt;hex file&gt;


If you want to set the EEPROM to something specific you can use avrdude to program an EEPROM file if the bootloader supports it (not sure it does, so you may need a programmer for it):

avrdude ... -Ueeprom:w:&lt;hex file&gt;