I've suffered a lot with back ache and back pain. If I were in your situation, lots of walking and gentle stretches would be the order of the day, but without more info I'm wary of making specific suggestions, because what works great for one person might make it worse for another.
In terms of preventative measures, walking and general daily movement goes a long way to minimising back ache, as obvious as this sounds.
When sitting at a desk, it's worth getting up for about ten minutes every hour, if possible, and doing normal daily tasks. What my manual therapist told me is that it's actually worse to jump out of your chair, do vigorous movements for for 30 - 60 seconds and then sit straight back down again. This actually causes the body stress rather that helping it relax. Gentle movements for longer is better.
But yeah, getting up periodically to do a job like load the dishwasher, feed the cat, walk to the post box or just do some gentle stretching should really help prevent another episode.