Use the backup/restore mechanism integrated in CODESYS to be prepared for unforeseen controller breakdowns. Open the device dialog of the connected controller by double-clicking on the device in the project tree and switch to the category "Backup and Restore". In the tab "Backup" you can read out the application information of the controller, select the desired scope and save it in a file. In the tab "Restore" you can open stored backup files, write them to the controller and in case of an emergency immediately load the application information.
An even more elegant way of emergency recovery is by using the CODESYS Automation Server: