If you had used the extrude function, you can repeat the last command simply by hitting 'g'. This is probably how you did it accidentally.