Doubt you can get your history back. But, to fix history recording, I would goto the URL opera://settings/clearBrowserData and clear both "browsing history" and "download history" for all time. Then, goto the URL opera://about, take note of the "profile" path, close Opera and delete the "History" file in the profile folder. You can delete the History-journal file too, which should be empty.
Then, history should start recording again.
Are you using Opera Sync and syncing History? If so, see https://reddit.com/r/operabrowser/wiki/opera/known_issues/#wiki_deleting_history_entries_can_wipe_out_all_history_when_opera_sync_is_enabled for something to avoid.