Quest items cannot be lost. Even ditched on the ground, they will stay permanently. If an NPC with a quest item in his pack is dismissed, the item is automatically transferred in PC's inventory. Quest related items are most often keys and such, but not only. For instance, even the Flail of Ages is considered to be a quest item.
Jaheira leaving the party after Galvarey's fight means most probably that your party's reputation is Disliked or even Despised. Donate a little money to a nearby temple before the start of the fight to raise your rep to Average(9-13) and she will not leave you.
Some hints(spoiler below):
This quest is one of the most valuable NPC quests in the game. You will receive 5 Rings of Protection +1 and 4 Cloaks of Protection +1, 2 Rings of Protection +2, 2 Amulets of Protection +1, a Ring of Wizardry, a set of Bracers of Defense AC 5, several bracers AC 6, potions and other items, plus a Harper Pin in the end. In order to get these, this is what you have to do:
After Galvarey is dead, Reviane&party will intercept you after a few days in a wilderness area. She will not fight you if your reputation is Popular or higher. So keep your rep on Average and slay them all.
After a few more days, Dermin appears. He will talk to Jaheira.
Dermin will appear a few days later and talk to Jaheira again. Afterwards, immediately after 1 rest, Jaheira will vanish and Terminsel will appear. A good thief may rob him for an Amulet of Protection +1 and Ring of Protection +2.
After rejoining Jaheira, your party will be intercepted in the wild after a few days. Kill them all. You'll get the Bracers of Defense AC 5.
Afterwards it will be good to raise your reputation to Heroic(17 and above). Try either donations to a temple or fulfilling quickly some reputation-gaining quests, or both. If you don't have Heroic reputation, then Jaheira will not receive her quest reward, the harper pin.
The harper pin is given by Terminsel. He can be looted again for a second Ring of Protection +2 and Amulet of prot +1.
Note: If you want to play with Jaheira, you cannot temporarily disband her once the quest has started, or even ended. She will never return in SoA, and you may eventually join her in ToB. If you don't, then the Harper Pin can be used by a Thief or Bard with UAI later in the game, with certain Wis and Cha requirements(equal to or higher than Jaheira's original Wis and Cha).