The answer very much depends on the precise wording of the wish, but I'll give my preferred answer.
The party moves back two hours in time, but remains in the same location since the wish did not specify moving in space. They retain all memories and remain in their current state, hit points, spells used up, down, etc.
Whether or not the current location is occupied by enemies depends on the adventure setting and how nice you want to be.
What happened, happened. Since they don't remember being in contact with their time-back selves, the time-back characters cannot interact with the first-time PCs. Similarly, the back-time PCs can't kill any previously encountered enemies because they know the first-time PCs must still encounter them.
If you want to get fancy, some things might be different and the time-back PCs might have to fulfill certain tasks to make the actions of the first-time PCs possible. E.g., the first-time PCs walked across a lowered drawbridge. The back-time PCs might have to kill some enemies and lower the drawbridge to make this possible.
I've always like the idea I got from an old SF story that the universe abhors change to the time-stream. In the story a man tries to avoid death by pulling himself from in front of a car that was about to run him over and a baseball-sized meteor falls out of the sky and kills him instead. The basic idea is that if a character tries to make a change to the time-stream that requires X energy, and a "natural" change to the time stream of adding a particular random-seeming event requires Y energy, and X>Y, then some random-seeming even will happen to prevent the PC from making the change he wants. This pretty much always involves some very heavy-handed DMing, and I'm okay with this for several reasons. First, I want changes to the time-stream to be very difficult. Second, I want travel to the past to be very dangerous. And third, I don't like time-travel stories or adventures, and reasons one and two discourage the players from taking the story in that direction.
So the PCs will have a couple options. They could run while they have the chance. Or they could hide and rest and recover for two hours, and attack the bad guys immediately after their first-time selves disappear. If they have the ability to significantly recover in the time available, I'd take the second option in their place.