I got back into cycling (and hiking/backpacking) relatively quickly in my recovery, cycling helps mobilise the lower spine again, seemed helpful when muscles were stiff from the initial spasm caused by the herniated disc.
Obviously I always have half an eye on the bike set up, I started back on a Cannondale Synapse (already relatively short and tall for a road bike) then flipped the stem up and fitted a 10mm shorter stem.
What seemed crucial was to keep lower back and hip/glute muscles nice and stretched, especially glutes I find. If they get short and tight they start to promote a rounding of the lower back which I don’t think is healthy!
Hiking with a heavy rucsac seemed like a miracle cure, I typically load my rucsacs top heavy, the effect of which is to pull you more upright as you hike. Being conscious of posture also, don’t lean into steep slopes as you hike up them, and equally, try to stay upright if you’re pedalling out of the saddle (spin classes are quite helpful for getting you into this habit, the teachers really like to emphasise engaging your core, to the point where you can almost pedal out of the saddle with one or no hands on the bars).