I have a question regarding this explanation below. Can I use "needn't have done" and "didn't have to" instead of "didn't need to"?
But we also use didn't need to to say that something was not necessary under circumstances where it was not done:
The sun came out so we didn't need to take any rainwear on the trip.
We had plenty of petrol in the tank so I didn't need to fill up.
We didn't need to wait for long for them. They arrived just after us.