I merged two branches into develop on 1st June which broke the working copy of develop branch. I am trying to hard reset these two branches to the last stable branch which is from 26th January. I did the following commands:
1. git status to check my branch
2. git pull origin <branch name>
3. git reset --hard <desired commit id for rolling back>
4. git push origin <branch name>
When I do the push command, I am getting an error message saying the current tip of my branch is behind. Now, I am unable to push the previous code from my machine (error message in the cmd picture). Is it happening because my colleague pushed some commits in between? The codes from my colleague is re-doable. I have talked to him. He has copy of the changes he has made. So, keeping it intact is not the issue. How do I reset the code to the previous stable version?
This is the error message from command prompt:
ntany@NaderaTany MINGW64 /c/wesis (code_refactoring_ds_dyadic_values)
$ git status
On branch Identification_of_n+1_query_problem
Your branch is up to date with 'origin/Identification_of_n+1_query_problem'.
nothing to commit, working tree clean
ntany@NaderaTany MINGW64 /c/wesis (Identification_of_n+1_query_problem)
$ git status
On branch Identification_of_n+1_query_problem
Your branch is up to date with 'origin/Identification_of_n+1_query_problem'.
nothing to commit, working tree clean
ntany@NaderaTany MINGW64 /c/wesis (Identification_of_n+1_query_problem)
$ git pull origin Identification_of_n+1_query_problem
From https://gitlab.informatik.uni-bremen.de/hheuer/WeSIS
* branch Identification_of_n+1_query_problem -> FETCH_HEAD
Already up to date.
ntany@NaderaTany MINGW64 /c/wesis (Identification_of_n+1_query_problem)
$ git reset --hard f5a7152c7b248c9c215f795f691a3f07e397528c
HEAD is now at f5a7152c patch query handling error
ntany@NaderaTany MINGW64 /c/wesis (Identification_of_n+1_query_problem)
$ git push origin Identification_of_n+1_query_problem
To https://gitlab.informatik.uni-bremen.de/hheuer/WeSIS.git
! [rejected] Identification_of_n+1_query_problem -> Identification_of_n+1_query_problem (non-fast-forward)
error: failed to push some refs to 'https://gitlab.informatik.uni-bremen.de/hheuer/WeSIS.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.