how can I undo accidently adding a script any other item to the wrong object in my

hierarchy? What if I added something quickly and I’m not even sure where I dropped it on to? is there any way to search the last commands done and remove it?

Edit → Undo? Alternatively, you could try deleting the script (back it up first!) then closing and re-opening the project; I think you’ll get an error telling you what is referencing the missing script.