You would need a back up of the wallet file or the plain text keys from the wallet to recover the funds. In an extreme case of file deletion, it may be possible to undelete or recover the data if it was not overwritten. The file could be overwritten if there was specialty security software that deletes data, or if the drive was in use and new data was written to the disk (this happens a lot in normal use; even when idle). Also, if the drive is a SSD, the drive or OS may be doing background TRIMs or garbage collection that will āoverwriteā the data.
If the value of the lost coins is very valuable, then the drive must be removed from use (remove power immediately) and then forensically examined - usually by installing it in another system as read only with TRIM/background features disabled and then making an dump of the raw disk data to an image file to analyze for raw data recovery. This is best left for professional data recovery companies that may charge thousands of USD $ to try to recover the data with no guarantee.
There may be a restore point in system properties/system protection (hopefullyš¬)(the feature will have had to have been activated beforehand and a restore point created while that info was in that folder otherwise theres no point in doing it, alot of times its automatic so youll have to check on all that)
If you have the wallet.dat file on an external disk, then do the following:
Make sure ZecWallet is shut down.
Copy the wallet.dat file from the external disk to the nodeās data directory (the directory where zcash.conf is). Donāt move the file, keep the backup on the external disk. In the case of ZecWallet on Windows, the data directory on recent Windows versions would usually be <Windows drive>:\Users\<username>\AppData\Roaming\Zcash. If thereās an existing wallet.dat in the way, rename that one to wallet.old first.
In the same directory, rename zcash.conf to zcash.conf.txt (accepting the prompt that this may make the file unusable, if youāre using the GUI). Double-click this file to edit it in notepad. Add the following lines at the end:
reindex=1
rescan=1
and save the file.
Rename zcash.conf.txt back to zcash.conf.
Run ZecWallet and wait for it to fully resync. This may take several days depending on the speed of your network connection.
After it has synced, shut down ZecWallet and make sure to reedit zcash.conf to remove the reindex=1 and resync=1 lines before starting ZecWallet again.
(@adityapk00, is there a simpler way to pass the reindex and resync options to zcashd?)