You can use the Disk Utility in macOS High Sierra to restore a disk image to a disk. A disk image (.dmg file) is a file that looks and acts like a mountable device or volume.
However, proceed with caution because your first have to erase the disk. If the disk image has multiple partitions, you must restore each partition individually.
To restore a disk image with a single volume to a disk:
- In the sidebar, select the volume that you want to restore, then click the Restore button or choose Edit > Restore. This is the volume that is erased and becomes the exact copy.
- Click the Restore pop-up menu, then choose the volume you want to copy. If you’re restoring from a disk image, click the Image button, then navigate to that disk image.
- Click Restore.
To restore a disk image with multiple volumes to a disk, you must partition the destination disk, then restore each volume individually.
- Open the disk image by double-clicking it in the Finder.
- The disk image’s volumes appear as disks in the Finder.
- Select the disk in the sidebar, click the Partition button, then partition the destination disk.
- The destination disk must have as many partitions as the disk image, and each of the disk’s partitions must be at least as large as the corresponding partition in the disk image.
- In the sidebar, select the volume that you want to restore, then click the Restore button or choose Edit > Restore.
- This is the volume that is erased and becomes the exact copy. Do one of the following:
- Restore from a volume: Click the “Restore from” pop-up menu, then choose the volume you want to copy.
- Restore from a disk image: Click Image, choose the disk image you want to copy, then click Open.
- Click Restore.
Repeat steps 3–5 for each remaining partition.
(This how-to is based on my experiences and info on Apple's support pages — where the images sometimes come from.)