github - After git checkout returns to the previous version, how to push the code written in the old version?
迷茫
迷茫 2017-05-02 09:25:54
0
2
753

Due to misoperation by other project staff at noon, some files in git were deleted. So I can only checkout and go back to the morning version.

Now I want to push the code I wrote today, but I keep getting this prompt. Is the git project still in the state of being accidentally deleted?

What should I do now to push the latest code?

Thank you~

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(2)
我想大声告诉你

Save your changes

git commit...
git tag tmp

Update master branch to remote latest

git checkout master
git pull origin master

Merge your changes and submit to remote

git merge tmp
git push origin master

clean

git tag -d tmp

DONE

巴扎黑

You first save your current points, then switch to the local master, then merge your points to the local master, and then pull the remote master. There should be a conflict at this time, because the remote is missing some things you have locally. Resolve the conflict and then upload your local master to the remote one

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template