You cannot remove or undo a command once it has been recorded. Instead, you can edit the script file after you stop recording or you can set your preferences to overwrite the script file and re-record the commands.

3. Stop recording

If you click again the record option it will end the session.

fyi:

The recording session has ended. Script recorded to D:\New Folder\user_projects\domains\test\Script1355000778567.py.

If you want to view recorded commands , you can view like goto preferences->wlst script recording->control