Also when he was in the desert.
Here’s where checking a bible is invaluable.
The “get thee behind Me Satan” is not attributed to that encounter. It is “get away from Me.”
Peter was to be redeemed, by making Christ first (that makes Peter a follower not a leader as he brashly had presumed to be). The devil will not be redeemed (even if it were offered to him, he would refuse).