I have managed to lock myself out of linux (ubuntu).
I installed amdgpu-pro, video drivers for graphics card (Radeon RX470) and then followed their guide to add myself to the video group with (as is)
sudo usermod -a -G video $LOGNAME
Then logged out for it to take effect, now when I login, the screen blinks off and then back to login screen. I tried changing password for my username using recovery mode logging in as root, but to no effect.
The guide I was following AMDGPU-PRO installation instructions