The idiom "let the cat out of the bag" means to accidentally reveal a secret or disclose something that was intended to be kept private. It is often used when someone unintentionally gives away confidential information.
Thus, the correct meaning is: (B) To reveal a secret unintentionally.