So I was trying to revert to a previous version of my program when it corrupted. Now, in my code I have various lines of code scattered throughout that are to the effect of:
<<<<<<< HEAD
=======
>>>>>>> parent of 410c297... "safe version"
=======
etc. When I try to revert to a previous point again, it says, "Unable to revert commit, (digits) (name)
I have a very basic understanding of the git terminal, so I can't really fix it myself. Can I get some pointers?
Reverting creates new commits that change existing committed files. You've got a merge in progress, which means you can't revert.
Most likely, you want to reset: you want to go back to an existing commit and pretend that you haven't done any work. The most common way of doing that is to get rid of all changes and in-progress merges by resetting to HEAD like this:
git reset --hard HEAD
Afterwards, if you want to go back to an even earlier version, you can revert
or maybe just checkout
the older version. Or you can do both at the same time using the ~ notation: git reset --hard HEAD~3
means undo everything and go back 3 commits.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With