2

I am writing both my PhD manuscript and a scientific paper.

Instead of writing the latter in Overleaf, I chose to do it on my TexStudio. I made a huge mistake of copy/paste the template of the paper to the second chapter (that took me three months to write), saved, closed the file and went to sleep. This morning I realized what I did... Is there any way I can recover my chapter PLEASE??

Wallflower
  • 143
  • 3

3 Answers3

4

You have a few options:

  • TexStudio may have cached history and allows going back before the fateful save and exit
  • Data recovery on the drive can find the bits of the previous chapter that were not overwritten by the new data
  • Your computer has cloud sync/backup software (such as OneDrive or Google Drive or iCloud) and you were working in a directory that is protected by this

I am not familiar with TexStudio and you mention it is an old version. If file/edit history is cached this will be documented and will be an option or tool within this program.

Data recovery requires several things: YOU have written anything else to the disk since overwriting this file, the OS hasn't written anything else to the disk since, recovery software can find the bits on the disk that previously belonged to the file, and none of the myriad other factors impacting this work against you.

Hopefully you have a cloud backup/sync tool actively running on your system, as this is the method most likely to work best. Going forward, you should definitely have such a tool going forward, if you do not have one currently. If you DO have such a tool running, you will need to look up how to use it to restore to a previous file version.

music2myear
  • 40,472
  • 44
  • 86
  • 127
3

Don't use the disk while you're trying to recover it! Writing to the disk may overwrite your data.

Methods for recovering deleted files :

  • Search the Recycle Bin for files with names identical or similar to the deleted file
  • Restore from Control Panel > File History (if turned on)
  • Restore previous version of the file by in Explorer, navigate to the file, right-click and select "Restore previous versions" (if enabled)
  • Try Windows File Recovery
  • Use a deleted files recovery product :
harrymc
  • 455,459
  • 31
  • 526
  • 924
  • The file was overwritten not deleted. I tried the third options, I have no previous version :'( – Wallflower Jun 03 '23 at 16:11
  • Those options also don't work for me, because I haven't turned them on. Don't give up - continue with the other options. – harrymc Jun 03 '23 at 16:12
  • 1
    When you say it was "overwritten not deleted" that's not technically true. Any safe filesystem would write a new version of the file, then once confirmed the write was successful, swap the pointers to the new location. The old file is still actually there on the drive, just not marked as in use. Your chances of finding it again with recovery software increase on a spinny rust rather than SSD & also if the drive is not encrypted. If it's both SSD & encrypted, then you can probably give up now. Next time, keep backups. Any data not stored in at least 3 locations should be considered temporary. – Tetsujin Jun 03 '23 at 16:32
  • 1
    @Tetsujin, I don't believe that to be true. I see now reason why a file system can not use the same clusters as those already allocated to the file. If for whatever write fails it can then allocate different clusters. It seems mainly dependent on application. I edited RTF file using LibreOffice > It *first* saved new copy then deleted original. So written to new location. If I edit using WordPad, it saves in place. If I then examine MFT, file occupies original clusters. But in itself file system has no problem using same clusters and thus overwriting original version. – Joep van Steen Jun 04 '23 at 01:12
  • For ref some good info here https://superuser.com/questions/1397186/when-a-pc-edits-a-file-does-it-delete-the-original-file/1399077#1399077 – Joep van Steen Jun 04 '23 at 01:25
  • @JoepvanSteen - I guess I'm just too used to how Apple do things ;) https://support.apple.com/en-gb/guide/security/seca6147599e/web I can't find anything with similar authority for NTFS. – Tetsujin Jun 04 '23 at 04:58
  • @JoepvanSteen: Correct. Most high-performance filesystems only guarantee consistency of the filesystem metadata itself in case of write failure. I.e. filenames, locations of clusters, that kind of thing. However, this does not apply to the *contents* of the files, only the *structure of the filesystem itself*. (Linux Ext4 can be configured in a mode where it extends this to files, but it is never done because the overhead is massive. I only did it (with Ext3, Ext4's predecessor) for removable drives back in the early 2000s before exFAT existed and Linux supported NTFS.) – Jörg W Mittag Jun 04 '23 at 10:04
-2

I hope you have luck, but if you have a SSD drive, it may not be possible to recover the old file data even if it's not overwritten by the new version because Windows might have overwritten the old data using TRIM commands:

It’s not possible to recover deleted data from TRIM enabled SSDs. This is because when an SSD erases data with the TRIM feature enabled the data being deleted is immediately overwritten permanently.

https://www.dataclinic.co.uk/data-recovery-and-the-ssd-trim-feature

For your personal backup, in addition to GIT, I think you should buy an external HDD, keep it plugged to an USB port and enable the Windows File History to take a snapshot every 10 minutes of any changes to your important files.

https://www.computerworld.com/article/3658132/how-to-use-file-history-windows-10-windows-11.html

Joep van Steen
  • 4,730
  • 1
  • 17
  • 34
Rafael
  • 1
  • 1
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jun 04 '23 at 01:25
  • 1
    That's not what TRIM is or does, your reference is wrong. Maybe they tried to simplify things, but as it's written it is incorrect. – Joep van Steen Jun 04 '23 at 01:34