I usually dressed in layers, but suppose I started off the day when it was warm, then I would carry a sweater and a lightweight windbreaker jacket in my backpack. I would have rain gear lightweight pants and an extra pair of socks. That way if the weather got cooler or rained I would be prepared for it.
Mostly it is important to get a weather report before starting out for a days hike. If your going to be gone several days then more thought needs to be put into the type and amount of clothes to bring along. It is foolish to carry more than you might need, but it is equally foolish to bring less then you might need.
I have done both thinking the day would be nice and getting caught in a down pour and getting totally soaked with no rain gear along, or carrying a sweater and extra clothes, and it being a really hot day made my load extra heavy with no relief. Careful planning is the best for any hike or camping trip.