might it be much better to disclose the full problem and provide some chemical data you have obtained ? Olivin is a s.s.s. with Mg-enriched members forming earlier than Fe-enriched members. Will this direct your thoughts in a direction where you can find an answer to your problem in this very general question ?
If by "restite" you mean the residual from mantle melting, the easiest is to look at the Magnesium number (Mg#): highly residual would probably be between 92-94% (or 0.92-0.94 in non-%). If by "from partial melt of peridotite" you mean crystallized from a partially melted peridotite (=basaltic melt), it will usually have a lower Mg# than 90.
I would like to refer to the classical diagram of Bowen and Schairer published already in 1935 to show the melting relations of olivine. At 1890°C we can expect forsterite (Mg) to be present at 100 % and at 1205°C fayalite (Fe) is present at 100 % .
This may give you an idea and also comes hopefully closer to an answer to the question above, as my first remark.
Sorry for switching back to this historical plot which has often been shown in many textbooks on magmatic petrology.
In general, high NiO2 and high Mg# suggest a mantellic rather than magmatic origin.
The answer might be not so easy in ophiolite context, particularly at the Moho transition zone, where olivine crystals in layered gabbro have such "mantellic signature", but it seems hard (for some) to accept that they may represent mantle xenocryst (I do think they are xenocryst). Re-equilibration with host mantle rock, by diffusion, could indeed obscur the original composition (?).
Even the reactive nature of the dunite of the Moho transition zone has been disputed, some suggesting that it was a cumulate layer eventhough the Mg# in those dunite and the associated harzburgite is very similar .
Here is the reference of an old paper in an obscur french magazine, which I have never been able to find. If anyone has anything along the same vein, I'd be interested...
Leblanc, M., C. Dupuy and C. Merlet, Nickel content of olivine as discriminatory factor between tectonite and cumulate peridotite in ophiolites, Sciences Géologiques, V37, 131-135, 1984.