Repository: sunpy/sunpy

Issue:
sunpy.data.manager.get  throws an error if attempting to redownload a file which has been deleted
### Describe the bug

There might be a good chance that  after downloading the file using data_manger .get() someone might accidentally delete it 
so the file stays in the database but is not present in the directory 

 https://github.com/sunpy/sunpy/blob/main/sunpy/data/data_manager/manager.py#L87-L97
when attempting to re-download it 
 and so line 97  (``` hash_file(details['file_path']) ``` throws error  since file has been deleted 

### To Reproduce

```
from sunpy.data import manager
import os 
@manager.require('test_file',
                 ['http://data.sunpy.org/sample-data/predicted-sunspot-radio-flux.txt'],
                 '4c85b04a5528aa97eb84a087450eda0421c71833820576330bba148564089b11')
def test2_function():
    return manager.get('test_file')

test2_function()

# file deleted 
os.remove("~/sunpy/data_manager/predicted-sunspot-radio-flux.txt")

test2_function()
```

### Screenshots

Traceback (most recent call last):
  File "/home/saurav/Desktop/test.py", line 13, in <module>
    test2_function()
  File "/home/saurav/Desktop/sunp_env/sunpy/sunpy/data/data_manager/manager.py", line 62, in wrapper
    self._download_and_cache_file(name, urls, sha_hash)
  File "/home/saurav/Desktop/sunp_env/sunpy/sunpy/data/data_manager/manager.py", line 98, in _download_and_cache_file
    if hash_file(details['file_path']) != details['file_hash']:
  File "/home/saurav/Desktop/sunp_env/sunpy/sunpy/util/util.py", line 197, in hash_file
    with open(path, 'rb') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/home/saurav/sunpy/data_manager/predicted-sunspot-radio-flux.txt'

### System Details

_No response_

### Installation method

_No response_

Discussion:

Patch:
diff --git a/changelog/7950.bugfix.rst b/changelog/7950.bugfix.rst
new file mode 100644
index 000000000..cd7265625
--- /dev/null
+++ b/changelog/7950.bugfix.rst
@@ -0,0 +1,1 @@
+Fix :meth:`sunpy.data.data_manager.manager.DataManager.get` now automatically redownloads files if they are accidentally deleted.
diff --git a/sunpy/data/data_manager/manager.py b/sunpy/data/data_manager/manager.py
index dc12eaeaa..536fb706f 100644
--- a/sunpy/data/data_manager/manager.py
+++ b/sunpy/data/data_manager/manager.py
@@ -94,6 +94,10 @@ class DataManager:
                 if file_hash != sha_hash:
                     raise RuntimeError(f"Hash of local file ({file_hash}) does not match expected hash ({sha_hash}). File may have changed on the remote server.")
             else:
+                if not pathlib.Path(details["file_path"]).is_file():
+                    warn_user("Requested file appears to missing and will be redownloaded.")
+                    self._cache._download_and_hash(urls, self._namespace)
+
                 if hash_file(details['file_path']) != details['file_hash']:
                     warn_user("Hashes do not match, the file will be redownloaded (could be tampered/corrupted)")
                     file_path = self._cache.download(urls, self._namespace, redownload=True)


Test patch:
diff --git a/sunpy/data/data_manager/tests/test_manager.py b/sunpy/data/data_manager/tests/test_manager.py
index f7f56857e..c1937c80a 100644
--- a/sunpy/data/data_manager/tests/test_manager.py
+++ b/sunpy/data/data_manager/tests/test_manager.py
@@ -248,3 +248,22 @@ def test_namespacing_with_manager_override_file(module_patched_manager, download
 
     # Storage still contains original test_file
     assert Path(storage._store[0]['file_path']).name == 'fake_module.test_file'
+
+
+def test_file_deleted_redownload(storage, downloader, data_function):
+    # Checks that if a file is deleted, a warning is raised and the file is re-downloaded.
+
+    data_function()
+    assert len(storage._store) == 1
+    test_file_path = Path(storage._store[0]['file_path'])
+    assert test_file_path.exists()
+
+    os.remove(test_file_path)
+    assert not test_file_path.exists()
+
+    with pytest.warns(SunpyUserWarning, match="Requested file appears to missing and will be redownloaded."):
+        data_function()
+
+    assert downloader.times_called == 2
+    assert len(storage._store) == 1
+    assert test_file_path.exists()