The large magnetocaloric effect (MCE) observed in Ni-Mn based shape-memory Heusler alloys put them forward to use in magnetic refrigeration technology. It is associated with a first-order magnetostructural (martensitic) phase transition. We conducted a comprehensive study of the MCE for the off-stoichiometric Heusler alloy Ni$_{2.2}$Mn$_{0.8}$Ga in the vicinity of its first-order magnetostructural phase transition. We found a reversible MCE under repeated magnetic field cycles. The reversible behavior can be attributed to the small thermal hysteresis of the martensitic phase transition. Based on the analysis of our detailed temperature dependent X-ray diffraction data, we demonstrate the geometric compatibility of the cubic austenite and tetragonal martensite phases. This finding directly relates the reversible MCE behavior to an improved geometric compatibility condition between cubic austenite and tetragonal martensite phases. The approach will help to design shape-memory Heusler alloys with a large reversible MCE taking advantage of the first-order martensitic phase transition.