Use the hash of the last commit where the file was present.
git checkout a22db0d1ddb7bc8777f43c0fda21a1c22dc75daa my_lost_file.c
Problem: the index is tracking the folder and gives problems when adding the submodule. Remove the folder first.
git rm my_submodule_folder
git commit -m "Deleting original folder"
git submodule add ../mysubmodule_url.git my_submodule_folder
git commit -m "Submodule added"
You can use git as a cli diff tool for any file outside git.
git diff --no-index path/to/file1 path/to/file2