In January 1861, Muir enrolled at the University of Wisconsin, three months later, the U.S. Civil War started and Wisconsin immediately began sending troops. In June of 1863, he left the university without completing a degree and within a year he was in Canada.
He wrote to his family in 1862, "I think I love my studies more and more, and instead of the time for dismissing them coming nearer, as one term after another passes, it seems to go farther and farther away. We live in changing times, and our plans may easily be broken, but if not I shall be seeking knowledge, for some years; here or elsewhere. Our University has reached a crisis in its history, and if not passed successfully, the doors will be closed, when of course I should have to leave Madison for some institution which has not yet been wounded to the death by our war demon." (John Muir Papers Letter from Muir to brother and sister 1862)
For more information...
Read The Young John Muir: An Environmental Biography, 1999 by Steven J. Holmes.