If you've ever connected your laptop or desktop PC to a secondary monitor and then disconnected without remembering to move the windows back to the primary desktop, you've probably encountered this problem:
There’s a simple trick to get around this. First make sure you've alt-tabbed to the window, or clicked on it once to bring it into focus. Then right-click on the taskbar and choose Move

At this point, you should notice that your cursor changes to the “Move” cursor, but you still can’t move anything.

Just hit any one of the arrow keys (Left, Right, Down, Up), move your mouse, and the window should magically “pop” back onto the screen.
Note: For keyboard savvy people, you can just alt-tab to the window, use Alt+Space, then M, then Arrow key, and then move your mouse.
Update: Note that you can also right-click on the taskbar and choose to Cascade your open windows, which will often help bring the windows back onto the screen
There’s a simple trick to get around this. First make sure you've alt-tabbed to the window, or clicked on it once to bring it into focus. Then right-click on the taskbar and choose Move

At this point, you should notice that your cursor changes to the “Move” cursor, but you still can’t move anything.

Just hit any one of the arrow keys (Left, Right, Down, Up), move your mouse, and the window should magically “pop” back onto the screen.
Note: For keyboard savvy people, you can just alt-tab to the window, use Alt+Space, then M, then Arrow key, and then move your mouse.
Update: Note that you can also right-click on the taskbar and choose to Cascade your open windows, which will often help bring the windows back onto the screen