Diaper on a potty trained toddler ?

My 2 year old is potty trained and has been for 4 or 5 months fully but today he has really mushy poops and he's already had a little poop in 2 pairs of underwear (I don't think he even knew it was coming bhe has a belly ache ). Would it be bad if I put a diaper on him for now just incase? If would that ruin potty training ?