TT #324 · Parashas Shoftim · Seventh Aliyah · Passuk 20:19
When you besiege a city for many days to fight against it to capture it, you shall not destroy its trees by swinging an axe against them, for from them you may eat, and you shall not cut them down; for is the tree of the field a man, to come before you in the siege?
Torah Temimah points to Sifrei Devarim 203.
TT lemma: כִּי מִמֶּנּוּ תֹאכֵל.
English: ‘For from them you may eat’ – to permit eating.
Derash permitting use for food (Sifrei) — the prohibition is against destruction, not against eating the fruit.
The fruit of the trees may be eaten during the siege; only their destruction is forbidden.