Now how can I get them back? Is it possible to edit MySQL database?
Solved.
Edited database, added group_id 13 to groups_aro_map table.
You should consider adding a failsafe for this situation - maybe a fixed user administrator account with permission to just edit user permissions?