0

By mistake I did few wrong commits. Now I want to restore my develop branch to a perticular commit-ID.

I tried

$git reset --hard 9f3df1996f435907575acafe922b22b88e6f10c4
HEAD is now at 9f3df19 Merge pull request #1 from txxxx/feature-1

This has brought the old repo of this commit to my local repo. But when I try to push this, it gives me an error.

$git push origin develop

To https://github.com/txxxxx/XXxxxx.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'https://github.com/txxxxx/XXxxxx.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.

I am not sure how to push these local code (brought from previous commit) to my develop branch now.

SwissCodeMen
  • 4,222
  • 8
  • 24
  • 34
AWS_Beginner
  • 382
  • 9
  • 21

0 Answers0