Electro-mechanical latch with cocking mechanism