I've experienced the same thing recently. I had quite a few boxes of unopened blood pressure medication due to several changes in prescription due to side effects.
Unfortunately a pharmacy cannot take the unused ones back as they cannot be given to another patient and would have to be destroyed.
What I would advise in the future is to just ask for one weeks supply when starting on a new medication. That way, there wont be too much waste if the drug is unsuitable.