Accidentally removed pbcopy
Unless you ran these commands in the directory /usr/bin, and with root privileges, you have not overwritten the real pbcopy - you've simply created a new file in your current working directory with the same name.

So - you most likely do not have to reinstall pbcopy. To verify, you can call the full program explicitly, like this:

cat foo | /usr/bin/pbcopy


which should work properly. If it does, you can delete the pbcopy you inadvertently created safely...