Git reset remote - resetting remote to a certain commit
- I want to discard all changes done after commit
git reset --hard
Now I want to do the same with my remote. How can I do this? I have done some commits (and pushes) after
I basically want to rewind my origin/master to
Use the following commands to solve git reset remote origin:
git reset --hard
git push -f origin master
Here assuming origin as your remote and master as your branch.
However, you should avoid doing this if anyone else is working with your remote repository and has pulled your changes. In that case, it would be better to revert the commits that you don't want, then push as normal.
From your query it's clear that you have already used git reset --hard to reset your master branch, you may need to start by using git reset --hard ORIG_HEAD to move your branch back to where it was before.
I hope this will help you resolve git reset remote origin.