I've been training for quite a while now - off and on since I was old enough to walk, starting with bodyweight exercises like push-ups, sit-ups and pull-ups outside the college weightroom while my dad and older brother pushed the metal. Eventually though, as a teen, I started squatting and have been ever since.
I've had a few injuries, aches, and pains along the way as well - some of them could be blamed on bad luck. There was the time one New Year's Eve when I almost drove right past a woman burning out her tires trying to get up an icy hill in a blizzard. My wife felt sorry for her and, next thing I know, there I was pushing her car up a hill in a blizzard as she continues to burn rubber, spitting up exhaust-ridden slush on my Dockers... I felt pretty good about myself until I followed that up by going to the gym to do a New Year's Eve countdown high-rep squat session and ended up straining my vastus medialis which later brought on a back issue.
There was also the time I pulled a hammy scooting out of bed to check on my then one year-old son who woke up screaming in the middle of the night. I then ended up with a lower back injury deadlifting a month later -no doubt because it was compensating for the injured hamstring.
Other problems were just from poor planning - too much too soon or for too long. Or, in some cases, no planning at all - an impromptu 315 deadlift for reps contest did me in one fine late Thursday night in November... Anywho, each and every one of those was a painful learning opportunity and not something I'd wish on any sensical weight-training fan. But, if you do find yourself in a bad situation, perhaps you can learn from some of the things I have done to help my returns to the squat racks. Again, this is no perscription, not advice - simply sharing my own experiences and hoping someone may find it useful. SEE A DOCTOR BEFORE ATTEMPTING TO SELF-REHABILATE YOUR BACK - if your injuries are severe, skeletal, or have damaged nerves, you will likely make things worse by waiting to seek professional care.
*REST - There is no substitute for rest and time to heal.
*ICE - later you can follow w. contrast treatments alternating ice w. heat to shuttle blood through the area, but in the beginning stages of recovery ice is standard procedure.
*NSAIDs & FISH OIL If there is inflammation, ice and maybe take some anti-inflammatories like ibuprofen or aspirin (don't overdo them).
*TENS (Transcutaneous Electrical Nerve Stimulation) - for spasm relief, it works wonders and forces the muscles to relax. Do NOT overdo it however. An inexpensive TENS unit can be purchased for under $100. I use it BEFORE icing, never after.
*LIGHT STRETCHING OF THE HAMSTRINGS AND HIP FLEXORS - understand that most hamstring stretches (as people usually perform them) result in spinal flexion and if you do them as such, you're going to make things worse. Keep your back flat and if you are feeling the stretch in your back rather than the hamstrings, STOP DOING THEM.
*LIGHT MASSAGE - There are a myriad of devices out there if you can't hire a massage therapist. I have had varied success with foam rollers, but $10 battery-operated massagers can provide a lot of relief.
*VERY LIGHT SQUATS OR OVERHEAD SQUATS - Overhead squats are a staple for me when coming back from lower back strain. The exercise demands a level of attention and posture that other squat variations do not. It is one of the best proprioception exercises in the world. If you have never been able to do overhead squats, this is NOT the time to start however...
*CONTINUED ICE (AND PERHAPS HEAT) - Ice AFTER stretching, light exercise, etc.
*CONTINUED MASSAGE, STRETCHING, WALKING, PROPRIOCEPTION EXERCISES
*ICE as needed (again, AFTER training)
*BEGIN RECONDITIONING ABDOMINALS & POSTERIOR CHAIN
*WORK ON YOUR FORM on key exercises like squats and deadlifts so that you don't reinjure your lower back.