Arduino nano doesn't remember sketch

My arduino nano started atcing weird recently. It basically doesn't remember the uploaded sketch when power is gone. When I repower it, it just runs blink sketch. What should I do?

It is impossible for an Arduino board to run the sketch on upload, but not remember it on power cycle. In order to ever execute the code, it has to be written to flash, which is non-volatile.

So I think more information on the symptoms is required, including what code you've been trying to upload to.

Are you sure it's not the "blink" pattern of the bootloader that you're seeing? Could your code be resetting the board because of a programming error?
Were you playing with the watchdog timer?