From the Dutch phrase "Voort seg ik!" literally meaning "Forward say I!". It was then adapted by South Africans into voetsek
, and then eventually "footsack" in English.
It was originally meant for dogs, but is now fairly commonly used against people as well, although in this context it's meant as a light-hearted "fuck off!"
The most common variation is the abbreviated "tsack", or the colloquial "tsek".