[libGDX] Collision detection and come back at the last position?

I’m building a platformer game with libGDX, I have learned Draw images, build user interface, and other things how input, outputs , etc but I can’t find a class or other for do the collision detection and when any thing collide with other (one can’t move, like the ground) and come back to the last position, for simulate a wall or something like it.

And how can I put gravity in mi game. I tryed do it with Box 2D but I need learn first more of libGDX, because Box 2D have things dot I don’t know how do it.

I don’t know if you are understand this, because I’m spanish.

Thanks.