Then he shows that care for men is different from that for brutes; hence he says, even the hairs of your head are all numbered. He shows that God's providence varies, in as much as he provides in diverse ways. For he had said about sparrows that not one falls to the ground without the Father; but here he says that not only you will not fall but not even the hairs of your head. And here he points out the providence over the slightest acts, because everything in them is ordained to them, and the Lord makes provision for them. But it should be noted that he says, are numbered. The reason is that ...it is customary for a person to count things he wishes to keep; whatever he wishes to dispose of he gives to someone. Hence this is the difference between providence over rational creatures and others, that the former are immediately ordained to God but the others not. Again, what we count we wish to keep for ourselves; therefore, he did not say that the sparrows are counted, because they will not exist forever. But there is a question here: If the hairs are numbered, will they not all be restored in the resurrection, even those that have been cut off? If so, the length will be unsightly. Some say that the matter will not perish, but that what is superfluous in one section will be transferred to another section. But if no hair has been lost, what then?
Here are three opinions: Some say that nothing will be resurrected except what pertains to the truth of human nature. Others say that only what has been cut off by Adam will rise, for his grew so much. But others say that not only what was cut off by Adam but also by our own immediate parent. Hence whatever is added, if it is truly human, will rise; but whatever does not pertain to the quantity of the parts will not rise. But against this it seems that heat acting on something moist and nourishing acts also on the root, and so a man does not consume one without the other, since they are mixed together. Therefore, it seems that a different answer must be given, namely, that whatever is of the truth will remain only in so far as it pertains to completeness. But by the truth of human nature I mean what is specifically flesh; but the other, materially flesh. The flesh will rise as to its species, though not according to matter. But what is meant by flesh according to its species? I answer that man's parts can be considered either as to form or as to matter: as to form he remains always; but if we consider the matter removed, something is lost and then replenished, as happens in fire. So if logs are added to fire, the fire remains the same specifically; yet there was matter according to the removal of the logs. Hence the more perfect will rise. Consequently, he does not say, "your hair is weighed," but numbered. Therefore, they will rise not in weight but in number.
Source: Commentary on Matthew