I removed my external drive icon on my macos, how do i put it back?
You can reset these settings to their default values by deleting their keys.

defaults delete com.apple.finder ShowHardDrivesOnDesktop
defaults delete com.apple.finder ShowRemovableMediaOnDesktop
defaults delete com.apple.finder CreateDesktop
killall Finder


Note that the CreateDesktop key is for determining whether any icons are on screen, so if you are able to put other files on the Desktop then the problem is not with the CreateDesktop key's value.