Cannot login to turn off maintenance mode after 7.24 I am new to Drupal, and although I managed to understand most of its principles, it seems I broke my site when trying to update it to the latest 7.24 release.

As instructed in UPDATE.txt, I entered maintenance mode and deleted all folders except sites/, which I had backup of course. I then copypasted all the new folders (including .htaccess) to my installation, and tried to run the update script. However, the update script said there were no pending updates. After that, the site was in maintenance mode, and even from my already logged in account I could not turn it off. I tried logging in again, and now I'm stuck in maintenance mode, and /user page redirects me to the main one. I tried emptying the cache tables, but nothing happened. I also tried copying the folders again, with no results. I enabled "update_free_access", and tried running the update script again, but no results.

Is there any way to avoid a blank installation?
7.24 has a security update and needs to add or change your .htaccess file for you public and temp files directory.

See what you have to add/change in drupal.org and here. I haven't done the 7.24 update yet so, this is as much i can help.