Use your hands to protect your neck, and not to get rid of the hooks your opponent does with their legs. Believe in the basic motion of the bridge -- yes, that one you do as warm-up. Always strive to glue your back to the ground.
Check out these and many other nuggets of advice by Renzo Gracie in order to armor yourself against attacks coming from behind.
These are extremely simple tips, but they will revolutionize the way you react in a scenario of maximum adversity.