when you open a file via OnlyOffice app in Nextcloud the file is copied to the OO-server. In my setup the files in the folder /var/lib/onlyoffice/documentserver/App_Data/cache/. There is a Directory forgotten for all documents which were not saved back to Nextcloud.
If you know the Documents which were not saved back to Nextcloud you can simply open the documents again and use “File” -> “Download as…” in OnlyOffice.
If there are many documents in the forgotten folder you need to understand how the digit directory names are created. In former versions of onlyoffice app it was simply Nextcloud’s fileid. But this is dangerous since multiple Nextcloud instances can use same OnlyOffice server.
I hope these are enough informations to get your data back from your OnlyOffice instance.