It sounds like you are after retraining. Move your army into a city you control, open the settlement's recruitment or production panel and switch to the retraining tab, then select the units you want brought back up to strength.
One requirement trips people up: the city must contain the building that produces that unit type, otherwise the option will not appear.
A habit worth keeping is to group units of the same kind together as much as possible. Retraining in bulk is considerably cheaper than topping up scattered single units.