Since there aren't any replies, I'm going to say what I did (and what I suggest not doing). This was for an exam about 4 years ago; I had a huge memory lapse in the Brahms G minor Rhapsody. I literally forgot what to play, so I looked at the examiners, half awkward-grinned, and then restarted the piece lol! They obviously had something to say about that in the comments, but I didn't end up doing that bad.
How to Recover from a Major Error
I heard that a famous pianist, I think Zimmerman or Ashkenazy, was playing Chopin Sonata 2 but had a complete memory slip, so he just played some possible chord progressions until he got his memory back lol