https://m.bulbapedia.bulbagarden.net/wiki/Damage
You can use these formulas based on whichever game you are playing. You'll have to work backwards, and you will not get an exact number due to the "random" multiplier that can produce high rolls and low rolls.