The Terminal app keeps a history of the commands you used. For one you can use the Up Arrow to scroll back the commands you entered or you can list the complete history with the following command:
history
If you cannot figure out how to reverse what you did, then you can restore your system from a backup you made before you made the changes using the Terminal app. If you don't have a backup (why not?), then you will need to do as @Ronasara suggests.
In the future don't use commands you don't understand. Always experiment on a test system until you understand the commands and how they work. Most users really should not need to use the Terminal app to manage macOS. Since the command line is very powerful you should always make sure you have a good backup before using the command line even if you are an expert with the command line.