Prophet Muhammad S advocated and implemented Qur'anic rules for the conduct of war, minimizing collateral damage, including damage to trees! Women, children and non-combatants were not to be harmed. When the enemy would stop fighting, they were to be given immediate sanctuary.
Fight in the cause of God against those who fight you, but do not transgress limits. God does not love transgressors.(Qur'an 2:190)
If they seek peace, then seek you peace. And trust in God for He is the One that heareth and knoweth all things. (Qur'an 8:61)
Thus the doctrines of protecting civilians, limiting collateral damage, granting amnesty to the enemy when they stop fighting, humane treatment of POWs and just and fair restitution were established. Only in the 20th century would other nations consider agreeing to such principles in the Geneva convention.