startx shouldn't have screwed anything up unless you were running as root AFAIK, but you could try messing with the .X* files in your home directory, something like 'mkdir Xfiles && mv .X* Xfiles/' and then try logging in. If that does nothing you can revert the previous command by running 'mv Xfiles/* . && rmdir Xfiles'.
You could also try simply running 'raspi-config' over SSH and seeing if you can fix it that way.