Don't panic if you've accidentally replaced an important file! There are methods to recover it. Various free software can help you scan your hard drive for deleted files. Additionally, if you've set up backups previously, your file might still be retrievable from there.
Recovery Steps
Consider Using PhotoRec (Works on Windows, Mac, and Linux)

Act quickly by refraining from saving anything on the affected drive. Avoid running programs to prevent potential data overwriting. Minimizing new data input increases the likelihood of successful file recovery.

Download PhotoRec for Free from Another Device

Prepare a USB Drive for File Recovery

Unpack the TestDisk Archive

Transfer TestDisk to the USB Drive

Connect the USB Drive to the Target Computer

Launch the PhotoRec Program

Choose the Disk for File Recovery

Specify File Types for Recovery

Select the Correct Partition

Choose the Filesystem Type

Choose Search Scope

Select Recovery Destination

Wait for File Recovery

Review Recovered Files
Recuva (for Windows)

Cease Saving on the Affected Drive

Download Recuva on Another Drive

Prepare a Blank USB Drive

Initiate the Recuva Installer

Modify Installation Settings if Needed

Choose Your USB Drive for Installation

Opt Out of Additional Install Options and Proceed with Installation

Access the Recuva Folder on Your USB Drive

Create a New Text Document in the Recuva Folder

Rename the Document to 'portable.dat'

Insert the USB Drive into the Target Computer

Launch the 'recuva.exe' File

Choose File Types for Searching

Select Search Locations

Initiate the Scan

Check Items for Recovery

Choose Recovery Destination
Recovering Older File Versions

Restore Older File Versions with Windows File History

Restore Older File Versions with Time Machine on OS X