Accidentally overwrote an important document. How do I retrieve the previous version?
If you haven’t tried editing the document again, it might be that the last copy is still in Backup, see Saving Documents Automatically
Without attempting to open the document again, navigate to the Backup folder and copy the [documentname].bkp file to another folder. Open LibreOffice and from there, open the copied file.
See also Preventing data disaster - The Document Foundation Wiki
Another possibility is to use a scavenging utility. MacOS file system relies on a journalling technique. This means that a file is not rewritten in place but saved like a brand new one and “pointers” are then switched in the file catalogue. Previous text is still present on the disk but inaccessible by usual procedure.
If you disk (partition) is not full, “stale” sectors are not immediately reused and your file is still recoverable.
I have not practised MacOS for a respectable number of years now, so I can’t suggest utilitiy names.