Mistakenly making two rukus

Q: What do I do in the case where I make a mistake during salah?

Today I made a mistake after saying samiallah hulimanhamidah, I went down to do ruku again. I suddenly stopped prayer because I realised this mistake, then redid the salah. I was on the first rakah. Is this when one does sajdah sahw? If so, how do I perform it?