For the past the ending is different but we find the same principle as for the present in the affirmative, negative form and as well as in the polite or neutral form.

taberu (manger) たべるAffirmativeNegative
Polietabemashita たべましたtabemasen deshita たべませんでした
Neutraltabeta たべたtabenakatta たべなかった