How can i undo this command
This script does a lot of unnecessary stuff, but especially suppresses the execution policy guards on PowerShell scripts, and also changes the starting condition of many system services to "manual" (so they don't start with boot).
This is not extremely harmful, but such widespread changes are not really helpful.
If you have enabled System Restore, I would suggest to rollback to before this was done. There are too many changes to undo one by one.
For more information on System Restore see
How to Create a Restore Point and Roll-back to a Previous Restore Point.