In this paper, we consider a time-fractional inverse problem in which the nonlinear boundary conditions contain an unknown function. A finite difference scheme will be proposed to solve numerically the inverse problem. This inverse problem is generally ill-posed. For this reason, we will employ the mollification regularization method with the generalized cross-validation criterion to find a stable solution. The stability and convergence of numerical solutions are investigated. Finally, some numerical examples are presented to illustrate the validity and effectiveness of the proposed method.