modifies .
"something that you don't want to get trampled or kicked" or "something that you don't want to trample or kick"
You're right that the means "X and then Y" or "if~~".
()= "hate it if~~" → "don't like/want..."
refers to .
> (= )
"they (accidentally/unintentionally) trampled and kicked something that they didn't want to get trampled or kicked / something that they didn't want to trample or kick"