This is what I remember,
The main character is a young man who joins—or is sent to join—the military. He arrives early at the training grounds and, while exploring, comes across a girl engaged in intense combat training. Through a twist of circumstance, he ends up sparring with her. Although he loses the match, his performance leaves a strong impression on her.
He later discovers that she is the daughter of a noble family. Because of this connection, he is sent to live with her family, where he begins learning magic and receives more advanced training.
After completing his time there, he returns to the military and is commissioned as an officer. He is assigned to a struggling, undisciplined platoon, which he gradually reforms and turns into an effective unit.