君子は豹変す(くんしはひょうへんす)

Japanese vocabulary

Meaning: a wise man changes his mind, a fool never; the wise adapt themselves to changed circumstances; the wise make no scruple in suddenly changing their demeanor

See it used in real works