No, God didn’t change His mind, nor did He make a mistake. God knows everything about us, and He also wants us to have what is best for us—because He loves us. The Bible says, “As for God, his way is perfect” (Psalm 18:30).
What, then, might have happened? One possibility is that you misunderstood God’s will—that is, you thought He was leading you to do something, but in reality He wasn’t. Sometimes we confuse our own desires for God’s will, and instead of prayerfully waiting for Him to guide us, we run ahead and end up missing His way. Peter thought it must have been God’s will for him to attack the guards who came to arrest Jesus—but he was wrong, and Jesus rebuked him (see Matthew 26:50-54).
But you weren’t necessarily wrong; perhaps God has been leading you all along—confusing as that may seem to you right now. Listen: God is sovereign, and He has not abandoned you! He knows what you’re facing, and He can be trusted to lead you in the future. Don’t be discouraged; God will be with you in the future just as He has been in the past.
Ask God to help you learn from this experience—but most of all, ask Him to help you trust your life and your future into Christ’s hands. Remember: God often uses life’s hard times to make us stronger. The Bible says, “We know that suffering produces perseverance; perseverance, character; and character, hope” (Romans 5:3-4).