Depending on the version of the Strapi project you can use the password reset CLI: https://strapi.io/documentation/v3.x/cli/CLI.html#strapi-admin-reset-user-password
Or you need to go into the database and delete all the admins from the strapi_administrators table which will allow you to register a new one.