Manual:$wgFileStore

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:

To enable undeletion, the 'deleted directory' must be defined and wgSaveDeletedFiles must be true, for instance:

example:

The 'deleted url' can remain null (as the deleted files are private, not visible to the Internet). The 'deleted hash' value is used to determine how many levels of subdirectories to be created under the 'deleted directory', default value is 3.