Discrete generator coordinate: Symmetry restoration in finite-dimensional spaces