Fight the Battle in the Spirit
It is the apostle John who reveals Peter as the one who cut off the servant's ear and also identifies the servant. It is very doubtful that Peter was aiming for Malchus' ear. It is more probable that he was making a horizontal swing at the servant's head and as the man ducked, Peter cut off his ear.
Peter was very vocal about never denying the Lord, and his actions proved that he meant what he said. There were only two swords among the disciples, yet Peter was willing to take on these six hundred soldiers. This spelled certain death or imprisonment.
Peter wanted to stand with the Lord, but he was not prepared spiritually. He was still strong in his own ability. If the battle would have been in the physical realm, Peter would have fought to the death as he proved here. But when Jesus told Peter to put up his sword and not resist with his physical power, Peter was confused.
Peter only knew how to rely on the flesh. When Jesus refused to allow Peter to fight with his sword, he was defenseless. If he would have been praying with Jesus, as instructed, Peter would have been built up spiritually and able to stand with Jesus spiritually without denying Him. As the prophet Zechariah said, "Not by might, nor by power, but by my spirit, saith the LORD of hosts" (Zechariah 4:6).
Likewise, we may sincerely desire to never deny our Lord, but it takes more than desire; it takes preparation. We all have been taught how to rely on ourselves, but we have to learn anew how to be strong in the Lord and in the power of His might (Ephesians 6:10). Just as in the physical realm, where muscles have to be exercised to become strong, so we have to exercise ourselves unto godliness (1 Timothy 4:7).