I did this in Civ3 and Civ4. My capital would be pretty safe, and I would keep one instance of the unique unit around, in the capital, as a memorial. Sometimes I would even name it, "Museum Piece." One of the fringe benefits of having dozens of units in those games.
I just stopped in to say I might do this going forward as a sort of royal guard. and keep them as whatever unit they were when they did there battlefield heroics
I typically do the opposite. And purposely send in the same division into every war as a sort of elite unit like certain special forces units or something. As a sort of source of prestige to my military on the war front. And if I'm a warring civ like Mongolia I tend to keep the general in the front with that unit like a sort of king.