Reputation: 1873
I successfully committed and pushed the latest code to the TFS git repository.
When I tried to sync the branch several hours later, VS2015 Team Explorer popped up a merge action with many conflicts.
I cancelled the merge.
This caused my commit to be lost. All my code in the last commit is gone.
Does anyone had this problem?
Is it possible to recover my previous commit?
Upvotes: 0
Views: 92
Reputation: 51183
Undo the merge will only block the sync action in TFS. It will not affect the previous operation- committed and pushed the latest code to local TFS git repository.
One of the most possibility could be you didn't commit successfully earlier. Code lost that never made it into source control is lost. Even though Git allowing you to commit to local repo before pushing to the server, allowing you to rollback/forward locally. But if you hadn't committed successfully locally, the issue is related to local repo not source control system(TFS), you could only try some recover git command such like the git reflog as VonC suggested.
Also suggest you to commit/check in locally more often.
Upvotes: 1