New King James Version (NKJV)
1 Samuel 23
26 Then Saul went on one side of the mountain, and David and his men on the other side of the mountain. So David made haste to get away from Saul, for Saul and his men were encircling David and his men to take them.
27 But a messenger came to Saul, saying, "Hasten and come, for the Philistines have invaded the land!"
28 Therefore Saul returned from pursuing David, and went against the Philistines; so they called that place the Rock of Escape.
29 Then David went up from there and dwelt in strongholds at En Gedi.
1 Samuel 24
1 Now it happened, when Saul had returned from following the Philistines, that it was told him, saying, "Take note! David is in the Wilderness of En Gedi."
2 Then Saul took three thousand chosen men from all Israel, and went to seek David and his men on the Rocks of the Wild Goats.
3 So he came to the sheepfolds by the road, where there was a cave; and Saul went in to attend to his needs. (David and his men were staying in the recesses of the cave.)
4 Then the men of David said to him, "This is the day of which the Lord said to you, ’Behold, I will deliver your enemy into your hand, that you may do to him as it seems good to you.’ " And David arose and secretly cut off a corner of Saul’s robe.
5 Now it happened afterward that David’s heart troubled him because he had cut Saul’s robe.
6 And he said to his men, "The Lord forbid that I should do this thing to my master, the Lord’s anointed, to stretch out my hand against him, seeing he is the anointed of the Lord."
7 So David restrained his servants with these words, and did not allow them to rise against Saul. And Saul got up from the cave and went on his way.