Nextcloud doesn‘t have a „history“ function of contact or calendar data. However, the complete data of your contact notes might still be in the database and you might be able to export the data either via the webinterface of the contacts app within Nextcloud or, if you have shell access to the server, with the script calcardbackup.
Hello, it’s sorry to say that there is no “history” in Nextclod. But your contacts are still here on your phone, the first thing you should do is to stop using your phone to avoid data overwriting. Then download a third-party tool, here I recommend the Bitwar Android Data Recovery, only if no data is saved on the database, you can still have your contacts back. I hoe it can do something for you, good luck.