For a Word document saved over with unwanted changes, look for a previous version or backup. Protect the current draft first, because it may contain useful work. Repairing the current DOCX is not a way to choose an earlier revision whose bytes are no longer in that file.

If the document is still open
Save a separate copy of the current state before experimenting. Undo may help when the relevant editing history is still available, but it is not a durable version archive and may not undo a replacement performed outside Word. Do not close a useful open document merely to force a recovery prompt.
Identify the target revision by content: the last approved paragraph, a particular table, or the draft before a known edit. The most recent version is not necessarily the one you need.
Check Microsoft 365 version history
For a file that was stored in OneDrive or SharePoint in Microsoft 365, open it in Word, select the filename in the title bar and choose Version history. Open a candidate in its separate window and compare the relevant passages before choosing Restore or keeping a separate copy. Microsoft documents this route in View previous versions of Office files.
The file must have been stored in the supported service while the needed version was retained. A local document does not acquire old versions merely because you upload it after the overwrite. Permissions, account and library settings can affect the available history. If history is absent, verify the account and original location rather than assuming a scan of the local synchronized file will reveal the service’s version list.
Look for a local backup
If File History protected the folder before the mistake, inspect the document or its containing folder’s Previous Versions, open the historical location and copy the candidate to a different destination. Check the date against the overwrite time. The File History documentation explains restoration from existing backups.
Word can also create .wbk backup copies when Always create backup copy was enabled under File > Options > Advanced > Save. Search for .wbk and open a candidate in Word; enabling the option now does not create the missing old draft. See Microsoft’s Word recovery article. Check email attachments and review-system exports as additional independent copies.
Compare before replacing
Keep recovered candidates under distinct names. Check the actual changed paragraphs, tables, comments and images. Use Word’s Review > Compare where appropriate to identify differences between two saved copies, then decide whether to restore one version or merge selected content into a new document. Keep comparison output in a new document, as described in Microsoft’s document comparison instructions. Do not let a date alone decide a collaborative revision.
If no older copy exists, a disk scan may search for separate residual files left by an application’s save behavior, but this is conditional. XRecovery can find remaining deleted document data; it does not promise to reverse true overwrite. Its Word-file repair addresses corruption in retained content, not historical editing choices. Preserve the present draft and clearly record what could not be recovered.
For the next step, see Document Recovery: Deleted, Unsaved, Overwritten or Damaged?.