But two things first.
There has not yet been a U.S. Civil War.
The Federal Government recognized that the states of the Confederacy had, in fact, seceded. After the war, the Confederacy was divided into military districts. Years later, the states were (re)admitted.
The Federal Government “recognized” secession in the same way the southern states “recognized” they were part of the union after the war — i.e., simply as a military fact, not as a justifiable fact.