Manual:$wgSaveDeletedFiles

Details
By default deleted files are simply discarded.

To save them and make it possible to undelete images, create a directory which is writable to the web server but is not exposed to the Internet.

Set $wgSaveDeletedFiles to true and set up the save path in $wgFileStore['deleted']['directory'].

The default settings are:
 * $wgSaveDeletedFiles = false
 * $wgFileStore['deleted']['directory'] = null

Note that these defaults disable all support for undeletion.