It always strikes me as an absurd question. There's a good reason why we don't know the end from the beginning: Frankly, if someone had told me five years ago what would happen in my life these past five years, I would have crawled under my bed and refused to come out. But I'm glad that I didn't choose that route. I have very few regrets about my choices, even if I do at times wish the consequences had been different.
Would I still have done Y? The short answer is, "perhaps not," if I was only looking at the short-term consequences of decision Y, especially if they were painful. But when I see the big picture, not only is the point completely moot (since I DID do Y, and there's no undoing it), but the question is based on a faulty premise. There is no possible way of knowing what I might have done had circumstances been different, or had I only known at the beginning the things I could only have learned by passing through the experience. The important thing is that I didn't know X when I did Y. I have since learned X, but I've also learned Q, R, S, and T, and they have strengthened and transformed me. And I learned all those things specifically because I chose Y. There was no other way. Furthermore, we know that all things work together for the good of those who love the Lord—that all of our choices can bring us joy if we allow the resulting experiences to bring us closer to God and to rely more fully on His power and mercy.
Now, I'm not saying it's a good idea to try crack because going through rehab will teach you valuable lessons (although I'm sure it would), or to sleep around because the painful repentance process that follows will ultimately bring you joy (though it will). But I am suggesting that we not beat ourselves up about past decisions we made using our best judgment and the limited information we had at the time. We didn’t know the end from the beginning, and if we couldn’t have foreseen the consequences, what’s the use in putting ourselves on trial for things beyond our knowledge or power to control? I don't think we do ourselves any favors when we judge our past selves based on our present knowledge. In the past we weren't the people we are today--how could we have been? We didn't know then the things we know today--how could we have? We hadn't had the same experiences, we hadn't learned the same lessons. In short, so much of what determines our choices is formed in the experiences that result from those choices. Since right now we only see “through a glass, darkly,” we could stand to be a bit more gentle with ourselves.
At least, I know I could.
Picture from http://www.scottpetersonproductions.com