What they say for horses is that if you’re going to walk behind one, stay just behind it. That way if it does decide to kick you, the legs won’t be able to build up momentum and will be mostly vertical before hitting you. Under no circumstance walk 1-2m behind it, you can die if it hits you in the head.
Apply at your own risk to cows.
TIL that it’s called a charley horse in English