There is a saying "man plans, and God laughs"; but the lesson of this chapter is "God wants for us to succeed, so we should act accordingly." If you do not give up on yourself, then the universe has your back.
As completely absent of goodness and holiness as war is, afterward, we must remember that all humans are infused with divinity. All sides are the children of God. As Deuteronomy teaches, the bodies of the deceased must be taken down and buried - in this case, an upright burial with stones. After the chaos, the time for being human begins once again.