If a licensed version of 10 was installed you can just install 10 and it should activate itself based on the systems hardware ID. But if you want to reinstall 8 you would need to buy a new key.
If windows has been removed/formatted and you lost the COA with the product key on it you are out of luck. Windows 8 doesn't do a digital entitlement like 10 does.
If a licensed version of 10 was installed you can just install 10 and it should activate itself based on the systems hardware ID. But if you want to reinstall 8 you would need to buy a new key.