I am working on visual studio and using git. I lost all my local changes after aborting commit. The steps which i did are:
Is there any way that i can get my changes back. I googled but didn't find anything useful.
That is why, before pulling, I always prefer to do a commit, just to be safe.
To be on the same side (unless you are on Mac with Time Machine activated), you can install the plugin local-history: it will save for you a state of each modified file.
Regarding git merge --abort
, the man page does mention:
The second syntax ("
git merge --abort
") can only be run after the merge has resulted in conflicts.
git merge --abort
will abort the merge process and try to reconstruct the pre-merge state.However, if there were uncommitted changes when the merge started (and especially if those changes were further modified after the merge was started),
git merge --abort
will in some cases be unable to reconstruct the original (pre-merge) changes.Therefore:
Warning: Running
git merge
with non-trivial uncommitted changes is discouraged: while possible, it may leave you in a state that is hard to back out of in the case of a conflict.