Nonvolatile flip-flop (NVFF) is an important component for implementing an energy-efficient logic large-scale integration (LSI) circuit that utilizes nonvolatile memory (NVM) function of magnetic tunnel junction (MTJ) devices. NVFF must be highly reliable in data store and restore operations for nonvolatile power gating. This study proposes an NVFF that can detect arbitrary errors occurring when storing data to the embedded NVM caused by the stochastic behavior of MTJ devices. The performance evaluation results show that the proposed NVFF can detect arbitrary error conditions, including the unsupported condition in the previously proposed reliable NVFF, while maintaining comparable performance to a conventional condition in normal flip-flop operations.