Before I’d touch the partitions of a disk with anything, I’d want a copy of the current layout. sfdisk makes that a one-liner, and the copy is a small text file you can read, keep next to your notes and feed back to sfdisk later.
sudo sfdisk --dump /dev/sdX > sdX.dump
cat sdX.dump
The dump starts with the label type (gpt or dos) and the UUIDs, followed by one line per partition with its start, size and type. The sfdisk man page recommends saving this for your devices, and the format is made to be read back. If a later change goes wrong, this puts the old table back:
sudo sfdisk /dev/sdX < sdX.dump
Replace sdX with your disk, and check it twice with lsblk before the restore, because that command rewrites the partition table of whatever disk you name. If you’re about to run another sfdisk command anyway, --backup saves the raw partition table sectors to a file in your home folder first, which is a nice extra safety net.
Some caveats. This is the layout only, not your data: if a filesystem gets overwritten, putting the old table back won’t bring the files back. Store the dump somewhere other than the disk it describes, or you lose both at once. And sfdisk restores the partition types and partition UUIDs exactly. That’s what you want on the same disk, but if you use one dump to copy a layout to a second disk, the man page warns you can end up with duplicate UUIDs on one system. With fstab lines that point at a UUID, that’s asking for trouble.
Further reading: sfdisk(8) manual page