I just fixed my cats It The way I did it was simpler.
1. add a new cat
2. click on the name of the new cat note the url https://sitename/wp-admin/categories.php?action=edit&cat_ID=20
change the =# to the Id if the cat name you lost and press return
3. you then can type the category name etc and save it. no need to change posts or delete of cats ( if you have access to the db the old table category has all the id/name etc. in it)
Chris Roberts Ph.D