In this paper, we solve the backward problem for a time-fractional diffusion equation with variable coefficients in a bounded domain by using the revised generalized Tikhonov regularization method. Convergence estimates under an a-priori and a-posteriori regularization parameter choice rules are given. Numerical example shows that the proposed method is effective and stable.