Luke 22:49-52 When they which were about him saw what would follow, they said unto him, Lord, shall we smite with the sword?
50 And one of them smote the servant of the high priest, and cut off his right ear.
51 And Jesus answered and said, Suffer ye thus far. And he touched his ear, and healed him.
52 Then Jesus said unto the chief priests, and captains of the temple, and the elders, which were come to him, Be ye come out, as against a thief, with swords and staves?
Matthew 26:51-53 And, behold, one of them which were with Jesus stretched out his hand, and drew his sword, and struck a servant of the high priest's, and smote off his ear.
52 Then said Jesus unto him, Put up again thy sword into his place: for all they that take the sword shall perish with the sword.
53 Thinkest thou that I cannot now pray to my Father, and he shall presently give me more than twelve legions of angels?
John 18:7-12 Then asked he them again, Whom seek ye? And they said, Jesus of Nazareth.
8 Jesus answered, I have told you that I am he: if therefore ye seek me, let these go their way:
9 That the saying might be fulfilled, which he spake, Of them which thou gavest me have I lost none.
10 Then Simon Peter having a sword drew it, and smote the high priest's servant, and cut off his right ear. The servant's name was Malchus.
11 Then said Jesus unto Peter, Put up thy sword into the sheath: the cup which my Father hath given me, shall I not drink it?
12 Then the band and the captain and officers of the Jews took Jesus, and bound him,
In Luke, Jesus says to the chief priests: Do you come out as thieves carrying swords and staves. He likens those who carry swords as violent criminals.
In Matthew, after rebuking Peter he tells: they that take the sword shall perish by the sword. It was advice not to use the sword. It was not the way to follow Christ. The Christian life was not with carnal weapons but with spiritual.
In John, Peter is identified as the one who cut off the ear, and Malchus is identified as the servant. Peter is rebuked for trying to prevent Christ from carrying out His Father's will--going to the cross. Self defense of Christ, was a betrayal of the will of God in this case.