It has been narrated on the authority of Sulaimin b. Buraida who learnt the tradition from his father. The latter said that the Messenger of Allah (ﷺ) said
The sanctity of the wives of Mujahids is like the sanctity of their mothers for those who sit at home (i. e do not go out for Jihad). Anyone who stays behind looking after the family of a Mujahid and betrays his trust will be made to stand on the Day of judgment before the Mujahid who will take away from his meritorious deeds whatever he likes. So what do you think (will he leave anything)?
This tradition has been narrated by the same authority through different chain of transmitters.
A version of the tradition narrated on the authority of 'Alqama b. Murthad has a differently worded end
It will be said to the Mujahid: Take from his noble deeds whatever you like. Then the Messenger of Allah (ﷺ) turned to us and asked: What do you think (will he leave anything)? - (i. e. he will take away everything).