Edmund Burke said this quote

History is the preceptor of prudence, not principles.