if you’re using mergemaster to update FreeBSD, sometime, if you don’t pay attention to diff, you may use the new master.passwd and group to overwrite the old one, then the root password will be missed.
Freebsd will backup master.passwd and group everyday to folder /var/backup. So just copy them back, and run