Created
February 1, 2017 16:19
-
-
Save bgadrian/84ae6795a59bfcd01263997d9f4859bf to your computer and use it in GitHub Desktop.
Git corrupted data, lose objects, errors.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Unfortunately you will lose any unpushed commits and stashed changes, however your working copy should remain intact. | |
cp -r . ../backupDontForget | |
rm -fr .git | |
git init | |
git remote add origin [your-git-remote-url] | |
git fetch | |
git reset --mixed origin/master | |
git branch --set-upstream-to=origin/master master | |
#commit and push |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment