If it is stuck in recovery mode and won't come out something probably went wrong.
Connect it to your computer. When Itunes open it should say something about Itunes detecting an ipod in recovery mode and ask if you want to restore it to default settings.
This will of course undo your jailbreak.