Usually we have two sides methods to deal with deleted environment variables issue.
1, recover environment variables from a same system computer
2, restore/reinstall system
Windows 10 has built-in reset channel, type reset this PC in search box and click Get started, this way will keep your files and reinstall current system.
Or you need to find another healthy computer which using the same version of Windows 10, copy its environment variables then paste on your PC.
More information here:
How to recover deleted environment variables?
https://stackoverflow.com/questions/32015759/how-to-recover-deleted-environment-variables
Please note: Information posted in the given link is hosted by a third party. Microsoft does not guarantee the accuracy and effectiveness of information.
-------------------------------------------------------------------------------------
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.