I was playing heads up in a Texas holdem game and I mucked my hand. and the other player didn't realize and mucked also. Who gets the pot?
In this case it would be the player that mucked last that wins the hand. Just because the other player didn't know you mucked or didn't show his hand doesn't disqualify him from winning - he wins if he mucked last.
If your opponent did not release his hand then there would be no confusion, which is why it's smart not to release your hand until you've received the pot. However, the fact that there is confusion doesn't mean we can't sort it out. The pot is always awarded to the last live hand; at the moment you folded your opponent held the last live hand and so they are considered the winner.
According to the rules, the game stops as soon as the is a clear winner/ winners (split pot), further actions do not count. This is like in (english) football, if a goal is scored and the ball bounces back out, and another player kicks it in the net again, it's still only 1 goal.