Restore flashdrive to original state diskutility
The command to erase a drive to one (visible) partition is:

diskutil eraseDisk FileSystem newVolumeName PartitionScheme diskIdentifier


Valid file systems are e.g. JHFS+ or MS-DOS. To get an almost complete list of file systems enter: diskutil listFilesystems. If the volume name contains spaces use quotation marks. Some file systems don't accept volume names with spaces. Valid partition schemes are APM, MBR and GPT. Some file systems require a particular partition scheme (e.g. APFS doesn't work with APM or MBR) Use the proper disk identifier by checking the output of diskutil list.

So

diskutil eraseDisk JHFS+ "FLASH 8GB" GPT disk2


would be a working command.

Some partition schemes will create more than one slice even if you chose to create one main volume only: 


GPT: invisible EFI partition with 100-300 MiB
APM: invisible Apple_partition_map with some KiB