When you hurt your back, usually hamstring stretching exercises can prove to be very helpful. If the muscles on the backs of your thighs are tight, they can usually cause your lower back to experience a lot of unnecessary stress and pain. You should stretch your hamstring muscles at least twice a day for 45 seconds at a time.
When sitting, always make sure you're straight. Not doing so will put strain on your spine that is not necessary. If you are sitting for a long time, make sure you are sitting in a chair that is comfortable and supportive. You can also sit on an exercise ball to improve your posture, as well as strengthen your back.
Back pain is a very physical problem. Pain is a physical feeling. Nevertheless, back pain can be caused by non-physical sources, such as stress, anxiety and repressed emotions. Stress and anxiety cause muscle contraction and stiffness which translate into back pain. Practice relaxation as well as a physical exercise for some relief. If severe, see a doctor.