Jacob wished to reveal the end [i.e., the time of Moshiach's coming] to his sons, whereupon the Divine Presence departed from him and he spoke of other things. (Rashi's commentary on Genesis 49:1)

Chassidic teaching speaks about the idea of cosmic precedent — how G‑d sets things up a certain way, even though they are subsequently undone, so that later, when the process is repeated, the lingering "memory" of the way it originally was should have an implicit (but not an tangible or sensed) impact on the way things unfold.

A classic example of this is the Chassidic interpretation of the Talmudic passage describing our pre-natal education: "The child in his mother's womb... is taught the entire Torah. But at the moment he emerges into the world, an angel comes and slaps him on his mouth, and makes him forget everything." The obvious question: Why are we made to forget the entire Torah? Obvious answer: Because G‑d wants us to study and achieve on our own, not to be granted knowledge as a gift from above. Obvious question no. 2: So why are we taught it in the first place? Obvious answer no. 2: Because the Torah, the wisdom and will of G‑d, is beyond the comprehension of mortal man. We could never attain it on our own; it must be taught to us.

In other words, we must be given the Torah — otherwise we could never obtain it. But we also must not know that we have it — otherwise we would never relate to it as something that is our own achievement and is therefore significant and meaningful to us. So we're taught everything, and then made to forget. We toil not to obtain something that is beyond us, but to regain what is already ours.

The principle of cosmic precedent applies not only to things that appear on the stage of history and then disappear, but also to things that almost happen — things that are supposed to happen, or meant to happen, or merely desire to happen, but are prevented from actually happening. When G‑d "changes His mind," what He is doing is setting up a potential precedent: He wants things to be a certain way in actuality, but He also desires that a different (or even opposite) reality should wield its influence on how things are. (The difference between an actual precedent and a potential precedent would be the degree of this influence, how accessible it is, how deeply concealed within our subconscious, etc.) Thus we are told that "In the beginning, it arose in G‑d's thought to creat the world with Justice; then He saw that the world could not survive it, so He put Compassion first and joined it to Justice." G‑d created a world that tolerates imperfection, but He placed absolute standards in the "background" because that represents its ultimate potential.

The same thing happens on Jacob's deathbed, when he desires to reveal to his sons the secret of Moshiach and the ultimate redemption. G‑d prevents that from happening, because it's integral to His cosmic plan that we should not know. But He allows Jacob the desire and the intention to tell us, so that the potential for this knowledge should exist, meaning that in the deepest recesses of our souls, the knowledge is there.

And that, of course, is the very place where this knowledge is most potent, and most useful. It's what has enabled us to survive the long night of Jewish history. It's how we know, with absolute certainty, that the Redemption will come.