Removing wood stain from drywall.
Hopefully you have some of the original wall paint left over somewhere. That's about the only chance you have of making it easily go away. Just make sure you carefully mask off the shelves with delicate surface painters tape if you just very recently finished them. If you use regular masking tape or any of the higher adhesion tapes you'll just end up peeling off your shelf finish and then you're back to square one again. Or, if you have a steady hand and the proper brush you can try your luck and freehand it, just know that you'll need to cut in against the shelves and then most likely (depending on wall color/sheen/visibility) you'll have to roll that area of the wall and feather out the edges to get the sheen and texture halfway close.
Without knowing the specific type of stain, or any info regarding the wall paint, it's going to be difficult to offer any other suggestions. Read the back of the can of stain and see what it suggests for proper cleanup. If it says mineral spirits then you could try dampening a rag with mineral spirits and lightly rubbing the stain to see what happens, just know before hand that you stand a good chance of removing the underlying paint along with it if you get too aggressive with your scrubbing. If you also clear coated the shelves with polyurethane or something, and got that on top of the stain on the wall to seal it in, then you're only real option is to touch up paint with left over paint, or repaint the room.
Some of the other folks might have a better solution, but it's tough since we don't have an info to go on, etc.