The finite-temperature Hartree-Fock-Bogoliubov (HFB) approximation often breaks symmetries of the underlying many-body Hamiltonian. Restricting the calculation of the HFB partition function to a subspace with good quantum numbers through projection after variation restores some of the correlations lost in breaking these symmetries, although effects of the broken symmetries such as sharp kinks at phase transitions remain. However, the most general projection after variation formula in the finite-temperature HFB approximation is limited by a sign ambiguity. Here, we extend the Pfaffian formula for the many-body traces of HFB density operators introduced by L. M. Robledo in Ref.[1] to eliminate this sign ambiguity and evaluate the more complicated many-body traces required in projection after variation in the most general HFB case. We validate our method through a proof-of-principle calculation of the particle-number-projected HFB thermal energy in a simple model.Introduction.-The Hartree-Fock-Bogoliubov (HFB) approximation is an important mean-field method for studying many-fermion systems in which pairing correlations are important. When extended to finite temperature [2], this method provides an efficient way to calculate statistical observables. The finite-temperature HFB approximation has been widely applied to study the deformation and pairing properties of nuclei [3,4] and is also useful for the study of atomic Fermi gases [5]. However, the finite-temperature HFB approximation often breaks symmetries of the underlying many-body Hamiltonian. In particular, the HFB approximation explicitly violates particle-number conservation if the pairing field is nonzero and can also violate rotational invariance when the mean-field solution is deformed. Breaking these symmetries reduces the accuracy of HFB predictions of statistical properties such as nuclear level densities [6].