If your code was on a dedicated branch for the current sprint/release, alls well and good. Switch to the master, create another branch and you are good to go...
But what happens when you work on the master?
Luckily, git has a inbuilt feature for you to create a branch from a previous commit. [You commit your code everytime there's a change, right? :) ]
You can create the branch via hash,
(Visual Studio Team Explorer has a link "Copy Commit ID" which allows you to copy the sha1 of the commit you want to branch from)
git branch branchname <sha1-of-commit>
or by using a symbolic ref.
git branch branchname HEAD~3
If you are on Visual Studio, you cannot do this from the IDE and would need to do it via the Git Bash console.
A word of caution when working with Git on Team Explorer in VS IDE.
-- When viewing history of the solution, it only shows history for the file and not for entire solution as you might think. At this point it would be better to use Git Bash or Git GUI to get the sha1 of the commit you want to branch from.