Any surgery is very difficult for a prey animal such as a cavy. The less invasive the surgery, however, the better the chances for complete resolution of the medical problem and a successful recovery.
Recovery can often follow a two-steps-forward, one-step-back pattern. It's important not to become frustrated or discouraged with an apparent bobble or setback in recovery, but to keep on doing the right things to support your pet.
Some surgeries require a recovery cage smaller than the pig's normal home, in order to limit movement. Others do not. Your veterinarian is the best person to help you with the specifics of your guinea pig's best recovery care.
Guinea Lynx Medical Guide: Post Operative Care