Had something similar happen to me once. A friend called me at 6pm once and said "What are you up to tonight?" I said nothing and he dropped the bomb. "Can you sit in with us tonight at 8?" Set was top 40 dance tunes and R and B stuff. I had played about 10 of the songs before, but about 5-6 years before. I knew everyone in the band so I stood by the keyboard player and he told me keys and the changes if I couldnt figure it out on my own a few bars ahead of time. I went pretty well. I listened to a couple of the songs on my phone on youtube on the breaks.
I played a wake for a friend a few weeks back where it was just a bunch of local musicians who got together in her honor and just jammed. The drummer and I had played together for a couple of years but the rest of us were friends but had never played together. It went ok. The guy singing just started a song and we went with it. Some songs went better than others.
A couple of times my band has thrown a song into the set that we had never played together before. The first time we did Night Ranger's Sister Christian, we had never practiced it as a band. I had worked out my parts on my own, the guitar player had done his the same way, and the drummer remarked before the show "Yeah, I've heard it before." It went pretty well. Later, we actually worked on it. We've done that a couple of times with different songs.
Overall, I like to prepare beforehand tho.
BnB