Wǒ yǐwéi zǒu cuò lù le, méixiǎngdào qiánmiàn liǔ'ànhuāmíngyòuyìcūn.
I thought I'd taken the wrong path - then ahead of me, another village appeared, and everything worked out.
Tips
history
From 陆游's Song-dynasty poem 《游山西村》: 山重水复疑无路,柳暗花明又一村 - 'Mountains pile on mountains, streams wind on - I fear there is no road; then past shadowed willows and bright flowers, another village appears.' Almost always quoted with the first half for the setup.
usage
Very common metaphor for breakthroughs after apparent deadlock - in business, relationships, research, diplomacy. Often shortened to 柳暗花明.