If you're riding after having knee pain, and you get swelling, you need to take it very easy on those first rides. Spin a lower gear, not strenuously, give it a chance to really recover and strengthen. I overdid it when I first started, years ago, right knee was constantly in pain and it lasted months. But I had gone car-free at the time so I didn't have much choice, and was basically riding one-legged. That really isn't necessary - back off and spin whenever you start to feel it.
FWIW saddle too low causes the knees to hurt.