Manual:$wgSaveDeletedFiles

Details
Prior to MediaWiki 1.11, deleted files were simply discarded by default (as of 1.11, this feature is enabled unconditionally). To save them and make it possible to undelete images prior to 1.11:
 * 1) create a directory which is writable to the web server, but not exposed to the Internet;
 * 2) Set $wgSaveDeletedFiles to true;
 * 3) Set up the save path in $wgFileStore['deleted']['directory'].

The default settings are as follows (note that these settings disable all support for undeletion):