I am working on a project with a partner and we use Git and Gitlab for version control. With his last commit he made some changes to the code and it does not work properly now. I wanted to revert to the version before his commit and I am given 4 options which I do not understand. I assume I should use the first or second option but I do not understand which code they refer by "staged for commit" - my code, his code, both? The thing is I had code that I stashed, then unstashed after the pull and do not want to lose.
Asked
Active
Viewed 48 times
1

kalina199
- 215
- 2
- 13
-
1https://stackoverflow.com/questions/3528245/whats-the-difference-between-git-reset-mixed-soft-and-hard/59675191#59675191 – matt Sep 23 '20 at 21:27
-
"staged" does not mean any particular person's code. It means what's in the index now. If you don't know what the index is, you need to find out, as otherwise you do not know what git is. :) – matt Sep 23 '20 at 21:28
-
maybe mine was not the right way to say it, but I mean maybe commits B, C and D as you explained in that post which is by the way very informative. I wish I had found it myself. What I am not sure about is if it possible to revert to an older version, continue with my current work ( I am implementing security) and after that check with my partner what to leave from his code ( he is doing the frontend) So maybe if I have A-B-C-D -master/origin I want to go back to A, do some work commit it as A' and then commit again B-C-D – kalina199 Sep 23 '20 at 22:02
-
2That sounds like Regret 3. Go back to A while leaving BCD on another branch. That way they are still there if you ever want them again. – matt Sep 23 '20 at 22:13