Spellshift

Oracle Text

Counter target instant or sorcery spell. Its controller reveals cards from the top of their library until they reveal an instant or sorcery card. That player may cast that card without paying its mana cost. Then the player shuffles their library.

Card Rulings

2/1/2007 If the targeted spell can’t be countered, it remains on the stack and the rest of Spellshift’s effect continues to happen.
2/1/2007 If the revealed instant or sorcery card isn’t cast, it gets shuffled back into the library.
2/1/2007 If there are no instant or sorcery cards in the player’s library, the entire library is revealed and then shuffled.