This blog post lists various approaches that you can use to restore administrative access to a solution based on the Sitecore ASP.NET web Content Management System (CMS).
You can lose administrative access to a Sitecore system in a number of ways (I've seen this issue at least twice just in the last two weeks). You can:
Depending on the specific circumstances, you have an number of options:
Because Sitecore treats user names and a role name as unique identifiers and references users and roles by those names, recreating a user should restore the access rights for that user completely, though some aspects of that user’s profile will have been lost.
If you create a Sitecore administrator user, be sure to create that user in the sitecore security domain. For example, instead of creating a user named admin, create a sitecore\admin user.
Of course if you integrate Sitecore with Microsoft Active Directory, you can use the tools provided by that platform to manage users and passwords.