Restore the default spctl
database:
sudo spctl --reset-defaults
sudo cp /var/db/.SystemPolicy-default /var/db/SystemPolicy
# reboot may be required
Add the quarantine back:
my_application="cURL"
my_date=$(printf %x $(date +%s))
my_uuid=$(/usr/bin/uuidgen)
/usr/bin/xattr -w com.apple.quarantine "0002;${my_date};${my_application};${my_uuid}" ~/Downloads/CHANGE_ME_WHATEVER
my_download_url="http://example.com/example.ext"
my_date=$(($(date +%s) - 978307200))
/usr/bin/sqlite3 ~/Library/Preferences/com.apple.LaunchServices.QuarantineEventsV2 "INSERT INTO \"LSQuarantineEvent\" VALUES('${my_uuid}',${my_date},NULL,'${my_application}','${my_download_url}',NULL,NULL,0,NULL,'${my_url}',NULL);"