If the branch was not squashed and you have it locally: I would checkout to the branch where you have the code you need (branch-1) and there I would just create a branch from that one(branch-1 -> branch-2). I would then develop on top of that and then merge it (branch-2) back to master.
If that is not the case, just rollback to the point where you have your code and develop from that.