There is no safety net on the command line except for what the user creates themselves by making sure any affected files are backed up. Nothing you discussed in this thread should have made any changes to your environment or macOS. Also, we have no way of knowing all the commands you ran or any files which you may have modified.
Be extremely careful using any commands found on the Internet without fully understanding what those commands and each option with those commands will do. You can get more information on each individual command by reviewing the manual "man" pages for each command which will also tell you what each option does. For example, for the commands mentioned in this thread you could check what each one by running these commands:
man sudo
man powermetrics
man grep
Be extremely careful when using "sudo" because it gives the command following it full root (aka admin) access which can very easily cause you to break macOS or even accidentally delete all your data without any way of recovering it except from a backup since data deleted using the command line does not go to the Trash. Without "sudo " pre-pending the command your local user data is still at risk from a mistake, but it does minimize accidents occurring outside of your home user folder. Keep in mind that even users with years of command line experience have been known to make a simple mistake that has had terrible repercussions....sometimes just because of a simple typographical error.