An overwritten workbook needs a copy of the earlier revision. Start with cloud version history or a backup made before the unwanted save. Keep the current file too: it may contain newer correct entries that you will want to merge after retrieving the older formulas or sheet.

Define the revision you need
Record what changed and approximately when: a deleted sheet, overwritten formula column, imported dataset or incorrect batch edit. Identify a few cells, a sheet name and a known formula that establish the desired state. A filename and date may not distinguish two near-identical copies.
If the workbook remains open, save the current state under a separate name. An available Undo action may reverse recent edits, but do not assume it will reverse a file replacement or survive closing Excel.
Use retained Microsoft 365 versions
For a workbook stored in OneDrive or SharePoint in Microsoft 365, select its filename in Excel’s title bar and open Version history. Select a version from before the error and open it separately. Inspect the relevant cells before choosing Restore. If the current file contains useful later work, keep a separate copy first. Microsoft describes this in View previous versions of Office files.
If no history appears, verify the exact storage location and account. A downloaded copy on the desktop is not the same object as the workbook in a SharePoint library. The available history depends on what the service retained; uploading the damaged revision after the mistake does not create its predecessors.
Restore a pre-existing local backup
For a folder covered by File History, inspect Restore previous versions on the file or containing folder. Open the historical location and copy the workbook to a separate folder before deciding what to replace. This relies on backups that existed before the error. See Microsoft’s File History procedure.
Check other independent sources: a collaborator’s attachment, a dated export or a previous delivery. An exported CSV preserves values from a single sheet; it is not a complete formula-bearing workbook. Keep the CSV as a reference for its values, not as a replacement for the original workbook.
Compare formula state and data state
Open both versions without immediately refreshing connections. Inspect the cells you identified, the full sheet list and hidden sheets when relevant. Check whether formulas refer to the intended ranges and external workbooks. Compare key totals with source records; a workbook may open correctly yet depend on another file that was also overwritten.
If you merge versions, do so in a new workbook copy and check formulas after moving sheets or ranges. Preserve the recovered revision as a reference rather than saving new edits directly over it.
When no older copy exists, a storage scan may find a separate residual workbook left by the application’s save process, but there is no general guarantee. XRecovery can search for remaining document data and repair listed Excel formats. Repairing current structure does not restore a historical worksheet whose bytes are gone.
For the next step, see Document Recovery: Deleted, Unsaved, Overwritten or Damaged?.