Where was Tziporah at the time of the Exodus?

In Parshat Yitro, Shmot 18:2-4 we read:

Moshe’s father-in-law, Yitro, took Moshe’s wife, Tziporah, after Moshe had sent her back home along with her two sons. The name of one was Gershom, because he (Moshe) had said, “I was a stranger in an alien land.” The name of the other was Eliezer, because the God of my father was my help, and rescued me from the sword of Pharaoh.

In Shmot 4:19-20 it looks like Moshe brought Tziporah with him to Egypt so how did she end up in Midian with her father?

God said to Moshe in Midian, “Go, return to Egypt, for they have died- all the men who had sought your life. Moshe then took his wife and his sons, set them to ride on the donkey, and he returned to the land of Egypt...

Rashi explains what happened: When God said to Moshe in Midian: “Go and return to Egypt,” Moshe took his wife and his two sons…When Aharon went out towards him and met up with him at the Mountain of God (Shmot 4:27), Aharon asked Moshe, “Who are these?” Moshe replied to him, “This is my wife whom I married in Midian and these are my children.” Aharon said to him, “And where are you taking them?” Moshe answered “To Egypt.” Aharon said to him, “We grieve for the earlier (enslaved) ones and now you come to add to their numbers!”

At that point, Moshe told Tzipora to return to her father’s house in Midian.

According to Siftei Chachamim, Moshe was worried that the Egyptians would enslave Tziporah if she came with him to Egypt. Therefore, he sent her back to Midian.

Since Tzipora and their sons were safe, there was no point in endangering them in Egypt.

We now see how Tziporah and their sons ended up meeting up with Moshe after the Exodus from Egypt, just in time for the Revelation at Sinai.