When you store a file that has the same name and size as another one, the Mac operating system will usually ask you if you'd like to replace the file that already exists. If you insist on replacing it, the file labeled with the same name as your new file is overwritten. That is what we call an overwritten file.
The overwritten file will still store on your Mac internal hard drive until a new file is written in its place. But you can't find it from any folder or location on your Mac using Spotlight because once the files are replaced by new files, the operating system will automatically remove them to free up space. To recover it, you can use Time Machine backup, iCloud backup, and data recovery software.
However, if you don't have backed up your Mac with Time Machine or iCloud, you can't proceed with data recovery using Time Machine or iCloud. Then the data recovery software should be your last choice to retrieve your overwritten files.
Here, iBoysoft Data Recovery for Mac is recommended. It is a professional data recovery software to recover replaced files on Mac. This powerful data recovery tool is compatible with Intel Macs and Apple Silicon Macs with M1 and M2 chips and also works on macOS 13/12/11/10.15/10.14/10.13/10.12 and OS X 10.11, which is also able to recover emptied Mac Trash.
To recover the replaced files from Mac using iBoysoft Data Recovery for Mac, do the following:
Step 1: Free download, install, and launch iBoysoft Data Recovery for Mac on your Mac.
Step 2: Select Storage Device or Disk Image under Data Recovery.
Step 3: Select your macOS internal disk and click Search for Lost Data to start scanning.
Step 4: Once the scanning process is finished, you can filter these recoverable files by different categories and then preview the scanning results. Once you find the overwritten file, select it and click "Recover" to retrieve it from the Mac disk. Rember to not store the recovered data in its original place to avoid data loss.