Doctors may recommend surgery to treat diverticulitis, a complication of diverticulosis.