what command to clear what I have drawn?

I have a problem,because I want to rotate a object by redrawing the object,but I don’t know how to clear the previous object,please tell me,thanks in advance!

Use:

glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BIT | GL_STENCIL_BUFFER_BIT | …);

Leave out what you don’t need.
You can set the values to which the framebuffer needs to be cleared with the commands

glClearColor(.,.,.,.);
glClearDepth(.);

Nico