How To recovery file recording

You don’t say which version of Audacity you are using, but in the current 2.1.2 version (available here: automatic recovery is highly effective and rarely fails.

Yes, it’s partly random. You need to use the file time stamp.
See here for more information about manual recovery:

Someone wrote such a script already, as an alternative to creating replacement WAV files. It requires installing python 2.7.6 (python 3 may not work correctly). See: For Windows, ideally we would package it into a ZIP file or installer including just the three required python libraries.