All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
You should have removed the obstacle, and then washed the body beneath it, so that your Ghusl (ritual bath) will be valid based on the fact that continuity is not a condition for the validity of Ghusl; this is the view of the majority of the scholars.
The Kuwaiti Fiqh Encyclopedia reads:
“Order (sequence) and continuity in Ghusl are not obligatory according to the view of the majority of the scholars. For this reason, if someone forgets the washing of a bodily member, or a place in a bodily member, whether in the body members that must be washed in ablution, or else, one should wash only the body part that he had forgotten, whether the time is long or short.”
But it is necessary to renew the intention to wash what was under the obstacle due to the interruption of intention. Al-Ruhaybaani said in Mataalib Uli an-Nuha when interpreting Ghaayatul-Muntaha:
“Continuity is a Sunnah in Ghusl as the Prophet did so, but it is not obligatory like the sequence, because the body is the one same thing, and if the continuity is interrupted, like if he delayed the washing of the parts of his body for a time when whatever he has washed previously has become dry, then he should renew the intention for the Ghusl because the intention is interrupted due to the continuity being interrupted; so he washes whatever remains without intention.” [End of quote]
This washing, that you completed, is sufficient for ablution, so you pray immediately after it if the ablution was not invalidated. But if anything that invalidates ablution occurs, then you have to perform a new ablution.
Ibn Qasim said in the footnote of ar-Rawdh:
“If he did not perform ablution and put water over his entire body, then Ibn Abdal-Barr and others said: “He has done what he is required to do.”; as Allah Says (what means): {And if you are in a state of Janabah, then purify yourselves..} [Quran 5:6] This is a consensus among the scholars, about which there is no difference of opinion.” [End of quote]
If he intends them and then invalidates his ablution, then he finishes his Ghuls and then performs ablution again.” [End of quote]
You must make up for the prayers that you prayed before completing Ghusl, according to the view of the majority of the scholars.
However, Shaykh Ibn Taymiyyah and those who agreed with him among the scholars said: “You do not have to make up those prayers.”
Allah knows best.