Unless it results in death, the damage is not permanent. Even death can be reversed through powerful magic. Rest can restore Hit Points (as explained in Chapter 8), and magical methods such as the healing wound spell Tiefling 5e or a Healing potion can remove damage in an instant.
When a creature receives healing of any class, the Hit Points recovered are added to its current Hit Points. A creature's Hit Points cannot exceed its maximum Hit Points, so every hit point gained above that number is lost. For example, a druid grants a ranger 8 Healing Hit Points. If the scout has 14 current Hit Points and has a maximum of 20 Hit Points, the scout recovers 6 Hit Points from the druid, not 8.
A creature that has died cannot regain Hit Points unless magic such as the revive spell has brought it back to life.