We are interested in solving the unique continuation problem for the heat equation, i.e., we want to reconstruct the solution of the heat equation in a target space-time subdomain given its (noised) value in a subset of the computational domain. Both initial and boundary data can be unknown. We discretize this problem using a spacetime discontinuous Galerkin method (including hybrid variables in space) and look for the solution that minimizes a discrete Lagrangian. We establish discrete inf-sup stability and bound the consistency error, leading to a priori estimates on the residual. Owing to the ill-posed nature of the problem, an additional estimate on the residual dual norm is needed to prove the convergence of the discrete solution to the exact solution in the energy norm in the target space-time subdomain. This is achieved by combining the above results with a conditional stability estimate at the continuous level. The rate of convergence depends on the conditional stability, the approximation order in space and in time, and the size of the perturbations in data. Quite importantly, the weight of the regularization term depends on the time step and the mesh size, and we show how to choose it to preserve the best possible decay rates on the error. Finally, we run numerical simulations to assess the performance of the method in practice.