Got it. This worked for me:
By launching sudo parted
I was able to do unit s
to switch to sectors, and p
to see the current table, and mkpart logical 501760 41940991
to recreate the partition. And quit from parted. Then I ran sudo fdisk /dev/sda
and used t
to set the partition type back to 8e