First, what a lot of people do if things go awry, is simply close the chat, and reconnect. People think that by doing so everything resets and they can restart from scratch. This is actually in fact not true! In fact, the chance is very big that you're making the matter worse!
When you close the chat (especially when using a web interface), it takes a bit of time for the server to realize that you're actually gone. In addition, if you didn't identify properly, Nickserv thinks that you're trying to steal the nickname, so Nickserv will use your nickname itself, preventing you from using it.
So if you close the chat, and want a "reset", wait at least 10 minutes before opening the chat again. If you want to go back in right away, try a different nickname if you can. Simply adding a 2 at the end of your nickname usually works.
However, the preferred option is really not to disconnect in the first place, but ask for help in the chat! If your nick is something like Nonick-BD6F31, don't fret. You can still talk. And by actually staying online, other people that know how IRC works can talk to you and help you do the right steps.
Hard and fast rule about nicknames: If something goes wrong, disconnecting and reconnecting makes it worse! So don't do it.