How to inverse-difference time series data? I'm preparing a time series model with LSTM, I noticed that the time series data is not stationary so I used diff(period=1) in pandas. I fitted the LSTM model and it looks good. I invert the difference operation using original data. When we are forecasting in real time, how to invert the predictions because the original data is not available?
How I inverse-transformed is
pred = model.predict(x_test_diff)
y_test_inv_diff = y_test.shift(1) + y_test_diff
pred = y_test.shift(1) + pred

I have the original dataset y_test, so I was able to inverse-difference predictions. What to do when I'm making forecasts in real time?

For Python implementation of Richard's answer:
x = [0,11,24,37,49,59]
print(x)
z = pm.utils.diff(x,lag=1,differences=1)
print(z)
z = np.insert(z,0,x[0])
print(z)
print(np.cumsum(z))

