You can miss this, although the game allows you to rewind easily and replay.
When in the cave with Petra, in front of the crafting table.
If you want to unlock this, simply craft a lever before you craft the sword.
(cobblestone on bottom centre, stick in middle")
This will unlock straight away.