German word order is very flexible. You can even put object before the verb. And not only subject or object but any part of a sentence keeping in mind the verb has to be at the second position.
Example:
Mein Urlaub beginnt in zwei Monaten. You can rearrange it in many ways.
in zwei monaten "beginnt" (verb at 2nd position) mein Urlaub
Another example:
Ich liebe dich. You can also say,
dich liebe ich. (in English you cannot say, "You love I", but it is possible in German) :)
The meaning does not change as it is clear what is subject and what is the object.
The reason for the shift is that it is for making stress in a sentence.
If you are stressing "dich" and not any other person.
Dich liebe ich, aber ihn mag ich.
Ihnen wünsche ich ein schönes Wochenende! :)