Spells such as Regenerate and Heroes' Feast (and probably others that I've missed, too) can heal undead, however I don't think that that's the real answer here.
The first answer is that undead can rest, just like anyone else. Crawford tweeted on this: https://www.sageadvice.eu/2014/09/19/undead-short-rest/ It doesn't mention long rests, but I think it's safe to assume that if they can take short rests, they can take long rests, too. So they have the same option for restoring health as any other non-spellcasting character or creature.
The second answer is that most powerful, sentient undead have a backup plan in case of death. It's often the reason they became an undead in the first place. Vampires, mummy lords, and liches of all kinds all return to life if they are reduced to 0 hit points unless adventurers manage to prevent them.
Many powerful dead have ways of healing themselves on top of this, usually at the expense of others. Vampires and demiliches suck the life out of their victims, and vampires continually regenerate on top of everything else.
So while spells that can heal the undead are indeed in short supply, the simple answer is that most undead don't really need them. Also consider that even if Cure Wounds and other spells like it could heal undead, those are spells that most undead wouldn't have access to anyway.
(dumb) 3.5 RAW:
Negative energy (such as an inflict spell) can heal undead creatures.
That's the only particularity of a undead regarding healing (besides the fact it can't heal itself).
Let's say you target a zombie with Heal. The spell's description tells us:
If used against an undead creature, heal instead acts like harm.
So we have to read the Harm text rules:
Harm charges a subject with negative energy that deals 10 points of damage per caster level (to a maximum of 150 points at 15th level). If the creature successfully saves, harm deals half this amount, but it cannot reduce the target’s hit points to less than 1.
If used on an undead creature, harm acts like heal.
It seems obvious we have to ignore the last line if we want to keep a little sense here. Basically what we learn is that casting heal makes us charge the zombie with negative energy that deals damage. The undead trait says undead can be healed with negative energy, not that every negative energy heals then, so it "makes sense" that you can harm it, with the heal spell, doing negative energy damage.
By the way, note that by casting harm on the zombie, you are supposed to make him gain HP through positive energy. That is the effect of the spell and does not trigger undead special ability.
Pathfinder rules on this are copy-pasted from 3.5, with the same nonsense.
RACP (rules as commonly played):
When you target a undead with positive energy, you make it take damage, when you target it with negative energy, you make it gain HP. That's pretty simple and the weird cases have to be houseruled by the GM.
I can't provide absolute evidence for the fact everyone plays with these rules, but this kind of material for example suggests undeads taking damage from positive energy.
Best Answer
Not automatically, no.
The Negative trait indicates that "Effects with this trait heal undead creatures with negative energy, deal negative damage to living creatures, or manipulate negative energy." The Undead monster trait states "Undead creatures are damaged by positive energy, are healed by negative energy, and don’t benefit from healing effects." The Negative Healing feature indicates that the creature "does not take negative damage, and it is healed by negative effects that heal undead."
So it seems fairly clear that there are forms of negative damage that do not heal undead. Rather, undead are immune to all forms of negative damage, and that there exist negative effects (like Harm) that heal them. There is no particular indication in the rules that negative damage should heal undead by default, and I would assume that it does not. Rather, the best available interpretation would suggest that negative effects only heal undead when explicitly stated to do so.