In Buddhism, kamma and its fruits is not a system of universal justice. It simply is cause and effect. An individual's intention is the most important thing in kamma.
If a person has evil intentions and commits evil acts, then he may end up in unhappy destinations. Even if he comes back as a human being, he may be sickly or short-lived or ugly or poor etc. Please read the rest of MN 135 for details. If based on his intentions, he harmed others, then in future, he becomes sickly. If based on his intentions, he was miserly and did not donate to others, then he may become poor in future.
According to MN 135:
The Blessed One said: "There is the case, student, where a woman or
man is a killer of living beings, brutal, bloody-handed, given to
killing & slaying, showing no mercy to living beings. Through having
adopted & carried out such actions, on the break-up of the body, after
death, he/she reappears in the plane of deprivation, the bad
destination, the lower realms, hell. If, on the break-up of the body,
after death — instead of reappearing in the plane of deprivation, the
bad destination, the lower realms, hell — he/she comes to the human
state, then he/she is short-lived wherever reborn. This is the way
leading to a short life: to be a killer of living beings, brutal,
bloody-handed, given to killing & slaying, showing no mercy to living
beings.
"But then there is the case where a woman or man, having abandoned the
killing of living beings, abstains from killing living beings, and
dwells with the rod laid down, the knife laid down, scrupulous,
merciful, & sympathetic for the welfare of all living beings. Through
having adopted & carried out such actions, on the break-up of the
body, after death, he/she reappears in a good destination, in the
heavenly world. If, on the break-up of the body, after death — instead
of reappearing in a good destination, in the heavenly world — he/she
comes to the human state, then he/she is long-lived wherever reborn.
This is the way leading to a long life: to have abandoned the killing
of living beings, to abstain from killing living beings, to dwell with
one's rod laid down, one's knife laid down, scrupulous, merciful, &
sympathetic for the welfare of all living beings.
"There is the case where a woman or man is one who harms beings with
his/her fists, with clods, with sticks, or with knives. Through having
adopted & carried out such actions, on the break-up of the body, after
death, he/she reappears in the plane of deprivation... If instead
he/she comes to the human state, then he/she is sickly wherever
reborn. This is the way leading to sickliness: to be one who harms
beings with one's fists, with clods, with sticks, or with knives.
"But then there is the case where a woman or man is not one who harms
beings with his/her fists, with clods, with sticks, or with knives.
Through having adopted & carried out such actions, on the break-up of
the body, after death, he/she reappears in a good destination... If
instead he/she comes to the human state, then he/she is healthy
wherever reborn. This is the way leading to health: not to be one who
harms beings with one's fists, with clods, with sticks, or with
knives.
However, not everything we experience is caused by kamma according to SN36.21:
"There are cases where some feelings arise based on bile... phlegm...
based on internal winds... based on a combination of bodily humors...
from the change of the seasons... from uneven care of the body... from
harsh treatment... from the result of kamma. You yourself should know
how some feelings arise from the result of kamma. Even the world is
agreed on how some feelings arise from the result of kamma. So any
brahmans & contemplatives who are of the doctrine & view that whatever
an individual feels — pleasure, pain, neither pleasure-nor-pain — is
entirely caused by what was done before — slip past what they
themselves know, slip past what is agreed on by the world. Therefore I
say that those brahmans & contemplatives are wrong."
So it is pointless to assume that if somebody hit you, it must be caused by you hitting someone else in the past. It may not have any kamma-related cause. In the quote above, "harsh treatment" is separated from "result of kamma". So, they are separate causes. "Uneven care of the body" and "change of seasons" are also other separate causes. So, if somebody hit you and it caused pain, then it may well be just "harsh treatment" from someone else.
How to alleviate one's karma is explained in the Lonaphala Sutta or the Discourse of the Salt Crystal.