Kornilov, an army general, wanted to establish a military dictatorship, and get rid of all Soviets, due to unorder in Petrograd. Initially, Kerensky supported him, but then panicked and called for Kornilov to halt it.
After Kornilov refused to halt it, Kerensky released Bolsheviks from prisons and armed them to stop kornilov’s uprising. The Red Guards had won the battle, and had arrested the leaders of the coup. The consequences was that the red guards had been created into a more efficient paramilitary unit, and had more weapons, that was given by Kerensky.