Kindly go to the Purchase >> Click on Cancelled >> Select Purchase invoice >> Click on Restore.
Note: Restoring Purchase will assign a new serial number. You can edit it in the next step if needed.