Disconnect external monitor without unplugging Mini DisplayPort Adapter
Do you mean you want to leave the secondary monitor plugged into the computer, but not use it?

You can go to System Preferences > Displays > Arrangement and check the Mirror Displays checkbox. Make sure your primary display is set to the laptop's built-in display. Then just shut the secondary monitor off (so you don't see the mirrored display).

Now all your windows will be on the primary monitor and you won't be able to drag any to (or open any on) the secondary monitor, but it will still be plugged into the computer.