I think I can prove the following

Theorem: Let $R$ be a $k$-algebra of finite type with a closed point $x\in \mathrm{Spec} R$ such that $\mathrm{Spec} R\setminus \{x\}\cong \mathbb{A}^2_k\setminus \{(0,0)\}$. Let $\tilde{R}$ be a $t$-adically complete flat lift of $R$ to $k[[t]]$. Then $\mathrm{Spf} \tilde{R}\setminus \{x\}\cong \mathbb{A}^2_{\mathrm{Spf} k[[t]]}\setminus \{(0,0)\}$.

As mentioned in the question, there do exist nontrivial deformations to $k[[t]]/t^n$ for any $n$; for that reason, I find this result surprising: Lifting to $k[[t]]$ poses a strong rigidity that I was not previously aware of.

In particular, there are no examples to the above question with $X$ affine. The proof below also shows that my intended application of algebraic deformations of the punctured affine plane cannot work, so I consider my question as answered in the negative (although strictly speaking the question posed is still open).

Let me start with something seemingly unrelated.

Proposition: Let $K$ be some field, let $X/K$ be a smooth surface, and let $C\cong \mathbb{P}^1\subset X$ be a smooth rational curve in $X$ with self-intersection $C^2 = 1$. Then there is an open subset $U\subset X$ containing $C$ and an open embedding $U\hookrightarrow \mathbb{P}^2$ (carrying $C$ into a line).

I deduced this (hopefully correctly) from the classification of surfaces (showing first that $X$ has to be rational); probably there is a more direct argument.

Now consider $Y=\mathbb{P}_k^2\setminus \{(0:0:1)\}$, with its line $C\subset Y$ at infinity. Let $R$ and $\tilde{R}$ be as above. Glue $Y$ with $\mathrm{Spec} R$ along $\mathbb{A}^2_k\setminus \{(0,0)\}$ to $\bar{Y}$ over $k$; this is projective, with $C$ an ample divisor. As $H^2(\mathbb{P}_k^2,T_{\mathbb{P}_k^2}(-C))=0$, one checks that any deformation of $R$ can be extended to a deformation of $\bar{Y}$ which also lifts $C$. In particular, $\tilde{R}$ can be extended to a proper flat formal scheme $\tilde{\bar{Y}}$ with a lift $\tilde{C}$ of $C$, over $\mathrm{Spf} k[[t]]$. By formal GAGA, this is algebraizable, to a projective surface $Z$ over $\mathrm{Spec} k[[t]]$, and $D\cong \mathbb{P}^1\subset Z$. The smooth locus of the generic fibre of $Z$, together with the generic fibre of $D$, satisfies the assumptions of the Proposition. It follows that there is a birational map from the smooth locus of the generic fibre of $Z$ to $\mathbb{P}^2_{k((t))}$. It cannot contract anything: If a curve $E$ was contracted, then this curve would meet the generic fibre of $D$ (as $D$ is ample), but in a neighborhood of $D$, the map is well-defined. Moreover, it cannot have critical points, as the target $\mathbb{P}^2_{k((t))}$ contains no exceptional curves. It follows that the smooth locus of the generic fibre of $Z$ is open in $\mathbb{P}^2_{k((t))}$. As its image contains an ample curve, it follows that the codimension of the image is at least $2$.

Now consider the reduction map $H^0(Z^{\mathrm{sm}},\mathcal{O}(nD))\to H^0(Y,\mathcal{O}(nC))$, where $Z^{\mathrm{sm}}\subset Z$ denotes the smooth locus; it induces an injection $H^0(Z^{\mathrm{sm}},\mathcal{O}(nD))/t\to H^0(Y,\mathcal{O}(nC))$. Both have the same dimension as $H^0(\mathbb{P}^2,\mathcal{O}(n))$. It follows that the map has to be surjective. It follows that $\mathrm{Proj} \bigoplus H^0(Z^{\mathrm{sm}},\mathcal{O}(nD))$ is a flat deformation of $\mathbb{P}^2_k$, thus is isomorphic to $\mathbb{P}^2_{k[[t]]}$. We get an open embedding $Z^{\mathrm{sm}}\hookrightarrow \mathbb{P}^2_{k[[t]]}$, which restricts to an isomorphism $\mathrm{Spf} \tilde{R}\setminus \{x\}\cong \mathbb{A}^2_{\mathrm{Spf} k[[t]]}\setminus \{(0,0)\}$, as desired.

Addendum: For completeness, I deduce the Proposition (in case $K$ is algebraically closed -- one can then remove this hypothesis) from the paper "Curves with high self-intersection on algebraic surfaces" of Hartshorne (I will use freely notation from there). We may assume that $X$ is proper. First, $X$ is rational: Fix a point $x\in C$. Because $C$ is very free, there is a $1$-parameter family of rational curves which contain $x$. As these curves intersect with multiplicity $1$, no two of them can have the same tangent vector at $x$. It follows that this family is defined over a rational base, thus $X$ is (uni-, and thus) rational. Now we use Theorem 3.5 in Hartshorne's paper. Case a) means that $C\subset X$ is equivalent to a section of a rational Hirzebruch surface $F_e\to \mathbb{P}^1$. The condition $C^2=1$ will then ensure that $e=1$, and that the curve $C$ does not meet the exceptional locus of $F_1\to \mathbb{P}^2$, giving the result. Case b) cannot occur. Case c) could cause trouble. Looking into the proof, only the case $m=2$ might occur. Looking at how the case $m=2$ comes about in Proposition 3.2, we see that we must have $e+n=1$. The case $e=0$, $n=1$ is impossible because of condition b) in Proposition 3.1, and the other case $e=1$, $n=0$ is impossible because of condition e) in Proposition 3.1.

`$\mathop{\rm Spec}R \smallsetminus \{x\}$`

, since`$\{x\}$`

has codimension 2. Am I missing something? – Angelo Jan 14 '13 at 20:15