That particular unit is gone forever, but after next Autumn, you'll have the chance to build if you have more SCs than units. So in a way, you can get a replacement for it then.
So say you've got 3 SCs and 3 units in Spring, and one of your units is dislodged, and you choose to disband it instead of retreating into your ally's territory (assuming those are your only options). Then in Autumn, with help from your grateful ally, you get another SC, bringing your total to 4. Since you now have 4 SCs and only 2 units, you get to build 2 new units (assuming you wish to and have 2 empty home SCs to build them in).
Or since this is Diplomacy, if your treacherous ally takes advantage of the situation to stab you and you lose a SC, then after Autumn you have 2 SCs and 2 units, so you can't build. But at least you don't have to disband now.
So everything is evened out over the Winter, no matter what happened during the fighting year.