Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Git – how to keep changes from remote and not erase newer

I have my local machine which has some recent developments I pushed to the remote, however I forgot something was messed up when I’d pushed last time to my remote machine.

commits on github remote:
commit C – contains new files I need, but something is messed up that I need from commit B
commit B – the last commit prior to C

How can I go back to commit B on my local machine, and then apply the changes from commit C?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I have read a lot, but of all things Git confuses me the most so please help without putting me down. I don’t want to make a mistake and have to start over because I didn’t understand what I read.

>Solution :

git checkout branch-name

for example if you want to go the version B and its name is temp

you do git checkout temp to obtain the version B git

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading