You don't give much information to work with!
Basically, empty them, put a 2x piece of lumber or plywood on the counter, and use an automobile jack to push them back up. Then use deck screws to fasten them, usually through a 1x3 board at the top. Predrill holes for the screws and angle them up so they hit the wall double top plate.