You could've also go in the cpanel and to your database find your user account to super admin and change the password
Login to your cpanel, PhpMyAdmin, (with the user and pass your used when you created the database to install Joomla)
Select your database in PhpMyAdmin
Select the prefixofyourtable_users table.
Click "Browse" and select "Edit" (the small pen icon) on the user whose password you wish to reset.
You will now see all user data in a form. Under the "password" field, you will see a long list of encrypted letters. Delete these letters, and type in a new password.
BEFORE saving, remember to select "MD5" in the "function" dropdown list.
Save your new password and log into the backend of your Joomla site. Remember to reset the password again from the back-end, as the MD5 encryption is much more secure this way.
Restoring your database worked too but if u had any new articles that weren't there when u got the backup of your database then u lost them.
I wished I would've seen this question before I get around joomla pretty good I had many issues and solve them without too much hassle please don't hesitate to ask me next time u have a problem I'll try my best to help you out 👍 have a good day.
I hope this helps anyone else who might encounter this issue