You will likely need a piston rebuild kit if there is one. You should replace the piston seal and the dust boot. There may be no damage and you could just carefully reassemble it as is but as cheap as these are, you might as well just replace them. You should never apply brakes with no pads/rotor in place unless your intent is to extract the piston (which you’ve done).
And by the way, there normally is no way to retract a brake piston without mechanical persuasion. That would require negative hydraulic pressure (suction). What you have done is to extend the piston beyond its normal operating limits because you disassembled the caliper and left the pads behind. When you applied the brakes there was nothing to keep the piston from simply pushing out of the caliper.