L'esprit de l'escalier
From Free Knowledge Base- The DUCK Project: information for everyone
What the French call l'esprit de l'escalier, that is coming up with the clever last word too late, when one is already on the staircase after having left the room.
A term that was sometimes used for this meaning is afterwit, wit of the staircase or repartee thought of only too late, on the way home.
In simple terms, when you did not think of a clever or witty retort in time, until it’s too late to be of any use. Something you thought of later and wished you had used, or imagined that you could have used, or pretended you did use at the time of the argument.