I did the following and got rid of the detachment without losing my changes
git branch detached-branch git checkout detached-branch