From Glitch City Laboratories
A game's save file is simply what file in a game is saved to while performing a game save. Usually, if the save file is deleted, all of the player's progress on the game will be lost. This can occasionally happen with glitches, though not as often as some say (for instance, the Old Man Trick can not erase a save file). A save file can also occasionally be wiped while using codes from a game-altering device. Sometimes when a save file is deleted by cheat codes, the game may only claim that it is wiped and not have any "Continue" option appear, and this can be fixed by simply resetting the game. However, regularly when the player's save file has been erased the Continue option will still appear to be present on the screen but when the player chooses to select it he or she will find that the game will display the message "The save file is corrupted." with or without an exclamation mark depending on whether the player's game is from the Generation II Pokémon games or Generation I respectively.
Pokémon games from Generation III and onwards such as Pokémon Diamond and Pearl save a backup save file; so if the player's current save file has been corrupted the game will helpfully load the last valid game save.