Thomas Huxley used the word "agnostic" to describe his stance on God, which was essentially a very scientific one: I cannot prove that God exists or not, so I cannot say whether I know God exists or not.
He chose the word "agnostic" based on the Gnostic movement, which got its named from the greek word for knowledge. At the time, Huxley never intended for the word "gnostic" to mean the opposite of "agnostic". However, as time went on, and both the Gnostic movement declined and the usage of the word "agnostic" gained traction, the word "gnostic" gradually did come to mean just that.
He chose the word "agnostic" based on the Gnostic movement, which got its named from the greek word for knowledge. At the time, Huxley never intended for the word "gnostic" to mean the opposite of "agnostic". However, as time went on, and both the Gnostic movement declined and the usage of the word "agnostic" gained traction, the word "gnostic" gradually did come to mean just that.