In 1848, Thoreau gave lectures at the Concord Lyceum entitled "The Rights and Duties of the Individual in relation to Government." This formed the basis for his essay, which was first published under the title Resistance to Civil Government in 1849 in an anthology called Æsthetic Papers. The latter title distinguished Thoreau's program from that of the "non-resistants" (anarcho-pacifists) who were expressing similar views. Resistance also served as part of Thoreau's metaphor comparing the government to a machine: when the machine was producing injustice, it was the duty of conscientious citizens to be "a counter friction" (i.e., a resistance) "to stop the machine."
In 1866, four years after Thoreau's death, the essay was reprinted in a collection of Thoreau's work (A Yankee in Canada, with Anti-Slavery and Reform Papers) under the title Civil Disobedience. Today, the essay also appears under the title On the Duty of Civil Disobedience, perhaps to contrast it with William Paley's Of the Duty of Civil Obedience to which Thoreau was in part responding. For instance, the 1960 New American Library Signet Classics edition of Walden included a version with this title. On Civil Disobedience is another common title.
The word civil has several definitions. The one that is intended in this case is "relating to citizens and their interrelations with one another or with the state", and so civil disobedience means "disobedience to the state". Sometimes people assume that civil in this case means "observing accepted social forms; polite" which would make civil disobedience something like polite, orderly disobedience. Although this is an acceptable dictionary definition of the word civil, it is not what is intended here. This misinterpretation is one reason the essay is sometimes considered to be an argument for pacifism or for exclusively nonviolent resistance. For instance, Mahatma Gandhi used this interpretation to suggest an equivalence between Thoreau's civil disobedience and his own satyagraha.