When I came to, I realized it had been a dream.

Literal

Eyes [obj-を] awakened-and-saw [discovery-と] dream was [nom-こと] [subj-が] understood.

~てみると ('upon doing and seeing') combines ~てみる with the narrative と. Casual past — わかった instead of わかりました. A typical Japanese way to mark the moment of realization that something turned out to have been a dream.