Both of them are correct, but they do not mean exactly the same thing.
"You did once" means "You did before" - you did something for some period of time before now. It may have been multiple times, just before now.
"Did you go to college."
"I did once, but that was a long time ago."
"You did it once" = You did it one time
"Have you gone white water rafting?"
"I did it once, but it was too much for me. I won't go a second time."