If that’s the yaml for it above, create a new device with the same name as the existing. Before saving copy & paste that code into it.
It should then be fine - you don’t need to reflash.
if you ever lose the yaml code for a device that isn’t on the dashboard - it’s gone forever. It is in no way recoverable from the device.