The very first thing that you should do when opening a new document from a Pages template is manually save that document to a known location with a real filename (not Untitled.pages). That does two things for you:
- Enables Pages AutoSave
- Enables Pages Versioning
Each time you open, edit, and close a Pages document after the initial save, changes are AutoSaved, and a new document version is maintained.
That said, any text that you have selected will vanish with any subsequent key stroke, and if you selected the entire document contents, and entered that keystroke, it would give the very true illusion that your document is gone.
However, on the Pages File menu is Revert To > Browse All Versions… which shows the current document on the left (yours may be blank) and on the right, a history of preceding document revisions that you can select and restore over the current document. It looks like this:

I suggest that you try this first, and if no success, then hopefully you have a Time Machine backup that you can go back in time and restore your Pages document as it was before the accident.