NOTE: The script and some information may be inaccurate in this tutorial, I'm under the impression my files were found because they were cached by vscode, nonetheless parts of the tutorial will work specifically if you have some contents of a file (strings, grep, dd)
This is a last resort after trying testdisk's un-delete feature which I find works quite well. In this situation however testdisk was unable to identify the files in the directory I was looking for. It helps to know a unique string in the file but is not fully necessary.
If the file is really important then stop writing to that disk, if it's only kind of important, depending on how full your disk is it may not matter if you're super lazy (I recovered this file a few days after the fact still using my disk as normal, but you should not do this). You should also probably at least work on a different drive during the process (saving these dumps and such to a different drive).