I think that several of the above ideas are worth combining.
1. Upper mgmt. has shown you that they can do what they want, when they want. They have flexed their muscles. You have good reviews, so it is not that. I suspect that your replacement was a friend of the boss, or, put in place to help protect him as a 'yes man', or as a lack of threat (as you could have been), and eventually will be a sacrificial goat for that boss. Your old boss is playing at politics, covering HIS OWN back - better that you are clear of him. He now has no trust value.
2. Going to the director that did this is a WASTE of time, and will probably ruin you internally or get you fired quick at that company. Better to work on doing the new task well as quick as you can, and add 'adapts to change quickly' to your resume'.
3. HR is always going to side with upper management. Often they have NO POWER to make policy, they follow what they are told. Tough for HR to criticize their bosses. In the US we don't have the protection that the Brits do, as mentioned previously.
4. If you think you have a legal case, persue it AFTER you have a new job somewhere else or at least are not working there anymore. If not, you are cutting your own throat.
5. ***KEY** AND, If the management allows this kind of thing to go on, DO YOU REALLY WANT TO WORK THERE MUCH LONGER? If management does not care about what you want to do as work, this is an important and negative quality of your management. And if they can do it once, they WILL do it again.
If they didn't even ask you about this assignment, then you are being treated as a serf, period. Is the management from another country? Their cultural attitudes may be that workers don't have to be consulted about these reorganizations.
I agree about the 'grin and bear it', learning as much as you can in the new position and doing your best at it, but also polish up your resume, reduce your debt, and aggressively start looking. It is better to go at your time and choosing than to have the company tell you to go.
6. I have seen one department suddenly being used as the 'exit door'. People would be advised that they now worked for that dept., even if they did not have the temperment or skills set, and within a few months many of them had quit out of frustration. Is your new department one of those? This can really make your life tough if it is.
Smile, learn, leave the building for lunch in the park, work well at the new position, all the while sending out your updated resume.