If at any time the speed of the planet in the reference frame of the star exceeds the escape velocity $\sqrt{2GM_\star/r}$, where $M_\star$ is the mass of the star and $r$ is the distance from the star to the planet, it will escape in a hyperbolic trajectory (or straight line if $M_\star\rightarrow0$).
As noted in the other answers, the result of the scenario will depend on the exact way that your central star is (re-)moved. I wrote a small Python code that calculates the orbit of a planet orbiting a $1\,M_\odot$ star (assuming $M_\mathrm{planet} \ll M_\star$). The simulation uses a Leapfrog integration scheme for advancing the position of the planet in time. After a time $t_\mathrm{go}$, you can move the star by a distance $dx$ per time step, and/or you can shrink the mass of the star by mass $dM$ per time step. You can play around with the exact values to match your favorite scenario.
The figure shows a simulation where after 10 years the star starts to move $dx = 0.1\,\mathrm{AU}$ and shrink by $dM = 0.005\,M_\odot$ per time step $dt = 0.25\,\mathrm{yr}$. With these parameters, after 51 years the planet escapes its star.

Red and yellow lines show the trajectories of the planet and the star, respectively.
import numpy as np
from matplotlib import pyplot as plt
G = 6.67384e-8 #Gravitational constant
Ms = 1.989e33 #Solar mass
M = 1 * Ms #Stellar mass
AU = 1.496e13 #Astronomical unit
yr = 365.25 * 86400 #Year in seconds
xo = np.array([0,0]) * AU #Star initial position
x = np.array([5.2,0]) * AU #Planet initial position
v = np.array([0,13.1]) * 1e5 #Planet initial velocity
moveStar = True
dx = np.array([.1,.1]) * AU #Star displacement per time step
shrinkStar = True
dM = .01 * Ms
dt = .25 * yr #Time step
tgo = 10 * yr #Time that star starts moving
tfin = 25 * yr #Time that simulation stops
r = np.sqrt((x[0]-xo[0])**2 + (x[1]-xo[1])**2) #Planet-star distance
a = -G*M / r**2 * (x-xo)/np.linalg.norm((x-xo)) #Acceleration
t = 0. #Time start
plt.clf()
plt.ylabel('x / AU')
plt.xlim([-6,6])
plt.ylim([-6,6])
plt.scatter(xo[0],xo[1],c='y',edgecolor='y',s=250) #Star symbol
while t <= tfin:
plt.xlabel('x / AU; t = {:.1f} yr'.format(t/yr))
plt.xlim([xo[0]/AU-6,xo[0]/AU+6])
plt.ylim([xo[1]/AU-6,xo[1]/AU+6])
plt.scatter([x[0]/AU],[x[1]/AU],c='r',edgecolor='r',s=10,alpha=0.25)
#Leapfrog:
xold = x #Old position
t = t + dt #Update time
x = x + v*dt + .5*a*dt**2 #Update position
aold = a #Old acceleration
a = -G*M / r**2 * (x-xo)/np.linalg.norm((x-xo))#Update acceleration
v = v + .5*(a+aold)*dt #Update velocity
r = np.sqrt((x[0]-xo[0])**2 + (x[1]-xo[1])**2) #Update position
plt.plot([x[0]/AU,xold[0]/AU], [x[1]/AU,xold[1]/AU],'r',alpha=.25)
plt.draw()
plt.pause(0.05)
if t/yr > tgo/yr:
if moveStar:
plt.scatter(xo[0]/AU,xo[1]/AU,c='white',edgecolor='white',s=300)
xo = xo + dx #Move star
plt.scatter(xo[0]/AU,xo[1]/AU,c='y',edgecolor='y',s=250)
if shrinkStar:
plt.scatter(xo[0]/AU,xo[1]/AU,c='white',edgecolor='white',s=300)
M = max(M-dM,0.) #Shrink star
plt.scatter(xo[0]/AU,xo[1]/AU,c='y',edgecolor='y',s=250*(M/Ms))