This word interests me because I often experience it! Work Coach Cafe says that “Treppenwitz is a German word that describes that flash of genius you get for a clever comeback after the opportunity has passed.” The Yiddish equivalent is trepverter ("staircase words"). In French it is l'esprit de l'escalier or l'esprit d'escalier ("staircase wit"). Some English speakers call this "escalator wit". "Afterwit" is also a synonym in English.
When used in English, treppenwitz expresses the idea of "staircase wit," but in modern German speech treppenwitz usually has a different meaning.