If you messed up your limits such that they prevent you from logging in, you'll need to reboot the machine into maintenance mode. Depending on exactly what sort of problem you created, adding
single to your boot options (in grub, hit "e" to edit the
kernel line, add
single to the end, hit esc to exit, then press "b" to boot) will often be enough to give you a shell. If you messed things up in a slightly different way, try adding
init=/bin/bash to the end, instead. In either event, that should give you enough access to resolve the issue.
If none of that works or in the worst case, you can always fire up a LiveCD and mount the affected drive in order to undo the changes you made.