The lever your referring to is your choke control. Its purpose is to enrich the fuel mixture during cold starts and low-speed running.
When you pulled it out, you increased the amount of fuel entering the engine. Consequently, increasing RPMs.
To use the choke properly:
1. Make sure the engine is cold.
2. Pull the choke lever all the way out.
3. Start the engine.
4. Let engine warm up for a few minutes with choke lever pulled out
5. Push choke lever back in once the engine is warm enough.
If the engine idles too high even after you've pushed the choke lever all the way in, there may be a problem with the choke cable or carburetor.