The present perfect is not used with a specific mention of time, and it seems that the second question ( When have you done this? ) is prompting the listener to answer with just such a mistake ( I have done this yesterday ). I would therefore use only the first one.
New words, one handy idiom, and a 2-minute quiz — delivered to your inbox to keep your streak alive.