"esprit d'escalier" (e-SPREE des-kal-i-YE) noun, also esprit de l'escalier
Thinking of a witty remark too late; hindsight wit or afterwit.
Also such a remark.
[From French esprit de l'escalier, from esprit (wit) + escalier (stairs).]
"We're all witty. It's just that many of us think of our clever remarks a bit too late. The French call it the staircase wit, indicating that one thought of that perfect retort on his or her way out."
Thank heavens for a.word.a.day. otherwise I never would have known there was a word for this! Proof that even after living in France for 21 years, I can still stumble upon a French expression that is totally news to me.