No need to reset root password (well, technically, Ubuntu's root does not even have a password). Do this:
- Reboot your PC
- In Grub's OS selection screen, choose "Ubuntu xxxx - recovery mode"
Now you have a console with root privileges. Add your user back to
usermod -a -G sudo youruser
The shell might reply that it cannot do it because the file system in mounted in read-only. To remount your fs in read-write:
mount -o remount,rw /
- That will be enough for sudo. But its suggested you also re-add yourself to other default administrative groups. You can reboot, logon normally and use GUI:
Menu > Administration > Users and Groups > Advanced Settings > User Privileges or
Account Type (Change...) > Administrative
Or use this command:
sudo usermod -a -G adm,cdrom,plugdev,fuse,lpadmin,sambashare youruser
Note: The 'sudo' group used to be the 'admin' group prior to Precise Pangolin. If you're on anything older, replace the group 'sudo' with the group 'admin' in the above commands.