Earlier we looked at pleurosaurs (Fig. 1, elongate, aquatic rhynchocephalians). Pleurosaurus goldfussi (Meyer 1831) was discovered first. Palaeopleurosaurus is a more primitive taxon with a distinct premaxillary tooth. Note the retraction of the nares, common to many aquatic reptiles.
The present blogpost updates their origins with phylogenetic analysis, adding these two taxa to the large reptile tree.
Dupret (2004) nested pleurosaurs (Fig. 1) with Sapheosaurus. Adding pleurosaurs to the large reptile tree (not updated yet) nested them with Marmoretta and Megachirella (Figs. 2-5), helping to remove the ‘enigma’ status from the latter. Dupret (2004) did not include these two taxa in analysis.

Figure 1. The pleurosaurs, Pachypleurosaurus and Pleurosaurus, known rhynchocephalians, now nesting with Marmoretta and Megachirella.
Pleurosaurs are yet one more clade of “return to the water” reptiles, and probably the last one anyone thinks of. They’re just not often reported on. Wiki reports, “Pleurosaurus fossils were discovered in the Solnhofen limestone formation of Bavaria, Germany and Canjuers, France.” The limbs were reduced. The torso and tail were elongated. Pleurosaurs probably swam in an eel-like or snake-like undulating pattern.
But where did they come from?

Figure 2. Marmoretta, a basal rhynchocephalian in the lineage of pleurosaurs
Marmoretta oxoniensis (Evans 1991) Middle/Late Jurassic, ~2.5 cm skull length, orginally considered a sister of kuehneosaurs, drepanosaurs and lepidosaurs. Here Marmoretta was derived from a sister to Gephyrosaurus. Marmoretta was a sister to Planocephalosaurus and Megachirella.
Distinct from Gephyrosaurus, the skull of Marmoretta was flatter overall with a larger orbit. The parietals were longer. The naris was larger and more dorsal. The prefrontal was narrower. The lacrimal was still visible. The jugal was reduced.
A flat-headed rhynchocephalian, Marmoretta nests near the base of that clade, prior to the fusion of teeth together and to the jaws in many derived taxa, including pleurosaurs.

Figure 3. Megachirella, a flat-headed rhynchocephalian close to Marmoretta and basal to pleurosaurs.
Megachirella wachtleri (Renesto and Posenato 2003, Renesto and Bernardi 2013) KUH-1501, 2 cm skull length, Middle Triassic, was a tiny lepidosauromorph with a moderately elongated neck and flattened skull. The teeth were short and stout. Megachirella was originally nested with Marmoretta and the large study confirms it, but it is also basal to the aquatic pleurosaurs.

Figure 4. Megachirella in situ with bones colorized using DGS techniques. Some bones are represented by impressions of the lost bone. The yellow premaxilla tooth is represented by a questionable impression/crack. The nasal may not be a bone, according to S. Renesto. Scale bar = 1 cm.
Shifting the pleurosaurs to Gephyrosaurus adds 13 steps. To Planocephalosaurus adds 23 steps. More steps are added with a shift to other rhynchocephalians.

Figure 5. Skull elements of Megachirellla traced in color (Fig. 4) then transferred to line art in three views. Reconstructions are important in such roadkill taxa.
Megachirella is a Middle Triassic rhynchocephalian. That leaves plenty of time for a sister to evolve into a Late Jurassic pleurosaur. The retracted naris common to pleurosaurs is clear on both Marmoretta and Megachirella. All three had an open lateral temporal fenestra.
If you find any mistakes here, please let me know. Such specimens are at or a little beyond the edge of my experience.
References
Carroll RL 1985. A pleurosaur from the Lower Jurassic and the taxonomic position of the Sphenodontids.
Dupret V 2004. The pleurosaurs: anatomy and phylogeny. Revue de Paléobiologie, Geneve 9:61-80.
Evans SE 1991. A new lizard−like reptile (Diapsida: Lepidosauromorpha) from the Middle Jurassic of Oxfordshire. Zoological Journal of the Linnean Society 103:391-412.
Fraser NC and Sues H-D 1997. In the Shadows of the Dinosaurs: early Mesozoic tetrapods. Cambridge University Press, 445 pp. Online book.
Heckert AB 2004. Late Triassic microvertebrates from the lower Chinle Group (Otischalkian-Adamanian: Carnian), southwestern U.S.A. New Mexico Museum of Natural History and Science Bulletin 27:1-170.
Meyer H 1831. IV Neue Fossile Reptilien, aud der Ordnung der Saurier.
Renesto S and Posenato R 2003. A new lepidosauromorph reptile from the Middle Triassic of the Dolomites (northern Italy). Rivista Italiana di Paleontologia e Stratigrafia 109(3) 463-474.
Renesto S and Bernardi M 2013. Redescriptions and phylogenetic relationships of Megachirella wachtleri Renesto et Posenato, 2003 (Reptilia, Diapsida). Paläontologische Zeitschrift, DOI 10.1007/s12542-013-0194-0