0

i am having an issue with github. I am not sure how to revert to my working version of the code.

What i have done is this :
I have attempted to merge my branch with master branch , but i was having alot of conflicts,
i tried to resolve those conflicts in the intellij tool and when all of them where done and i tried to run the code i got many errors like these

java: Couldn't find referenced attribute id for com.example.ticketing.model.ClientSubscription.client_id

I tried adding the missing fields to the classes with no success.

I am not sure how to resolve this and i want to revert the code to my previous commit. when i do git reset --hard <commitnr>

it says my head is at that commit , but after that i am using git pull to fetch the old content.

Everything seems to work at first but when i am running the code again i get the same errors as before like nothing changed.

What am i missing here?

Any help would be greatly appreciated !

LeGEC
  • 46,477
  • 5
  • 57
  • 104
helloApp
  • 449
  • 1
  • 4
  • 21
  • You're resetting it to an old commit. Then you pull the newer code from your remote. The branch then gets fast forwarded. I'm not sure what you expect the outcome would be? You're doing nothing with the old code. Try running the old code without the new changes. Then redo the changes and keep checking if the code breaks before committing. – Tschallacka Oct 22 '20 at 10:50
  • i am expecting to run the code without errors like these ```java: Couldn't find referenced attribute id for com.example.ticketing.model.ClientSubscription.client_id``` wich are still present when i run the code after i do the reset and pull. – helloApp Oct 22 '20 at 10:55
  • @Tschallacka why does it have the same errors after i have made the pull? it should be my old code, no? – helloApp Oct 22 '20 at 11:01
  • No... you are resetting to commit #10, without errors, then you pull commit #11 with errors from remote. Your local commit is then #11 with errors. – Tschallacka Oct 22 '20 at 11:08
  • @Tschallacka ah i see, but then how i pull the previous commit/push ? – helloApp Oct 22 '20 at 11:39
  • https://stackoverflow.com/questions/22682870/git-undo-pushed-commits – Tschallacka Oct 22 '20 at 11:41

0 Answers0