You need to tighten the bolt that holds the shifter in place ...
If the "washer" (which provides the friction) is worn, you can make a new one from a plastic MILK cap -- punch a hole in the middle, trim to fit, install.
Check your chain for wear - this started happening to me once and a few days later the chain broke. A bad link can cause the chain to stretch under tension and skip to a different gear.