In yoga classes, it's important to listen to your own body first and make responsible decisions about which poses are not a good fit for your body. This sometimes leads to an awkward situation where you're left on your mat unsure of what to do at the class proceeds into a pose you are skipping. As you get more familiar with yoga, you'll be able to make your own substitutions when necessary. If you are taking a pass on inversions such as shoulderstand or headstand, I suggest you try legs up the wall with no wall instead. You don't need to move over the to wall to do this version of the pose. If you have a block handy, try placing it under your sacrum if that feels good. Now just hang out until the class moves on to the next posture and you can join back in.