This has been requested many times on Moodle forums and Moodle tracker to have the ability of restoring the deleted files aka “Recycle Bin”. Now, Skylar Kelty has developed the recycle bin plugin which adds a “recycle bin” for course modules to Moodle.
Acc. to the plugin description:
This plugin adds a “recycle bin” for course modules to Moodle. It requires a core hack as there is no pre-cm-deleted event, you will need to add a line to ‘/course/lib.php’
Please note that this plugin will store a backup of user data in Moodle’s dataroot and results in overusage of diskspace in some cases.
You can download the Recycle Bin plugin from https://moodle.org/plugins/view/local_recyclebin