How undertaker managed to fight with undertaker?

In 1993, the Undertaker was 'buried' in a Casket match. In 1994, a second "Undertaker" (Played by Brian Lee, instead of Mark Calaway) was introduced by Ted DiBiase (Sr.), prompting the return of the Undertaker. The infamous fight to which you are referring occurred at SummerSlam 1994, with the 'real' (Calaway) Undertaker defeating the 'fake' (Lee) Undertaker.