if you have just master branch and wanna back to "develop" or a feature just do this :

    git checkout origin/develop

Note: checking out **origin/develop**.

You are in **detached HEAD** state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout...

then

    git checkout -b develop

It works :)