You want to remove duplicated lines in a file or from stdin.
You can combine uniq and sort to achieve this.
uniq
sort
sort garbage.txt | uniq -u cat garbage.txt | sort | uniq -u