TLDR: doing a git reset --hard origin/mybranch resets the local repo to a much earlier version instead of the latest one.
Dev branch looks like this:
I think this is best explain with an example
[myusername@myhost myapp]$ git branch
* dev
[myusername@myhost myapp]$ git pull origin dev
From bitbucket.org:
* branch dev -> FETCH_HEAD
Already up-to-date.
[myusername@myhost myapp]$ git reset --hard origin/dev
HEAD is now at 2be5b0e Merged in mybranch (pull request #57)
[myusername@myhost myapp]$ git pull origin dev
From github.com:myusername/myapp
* branch dev -> FETCH_HEAD
Updating 2be5b0e..2cdc555
Fast-forward
--file list here--
19 files changed, 324 insertions(+), 196 deletions(-)
[myusername@myhost myapp]$ git log
commit 2cdc555dde1ef7ef187756036bb2d19dacae0c26
Merge: 6c9399d fc7d29f
Author: First Last <first.last@myhost.com>
Date: Thu Jun 4 00:53:16 2020 +0000
Merged in mybranch (pull request #81)
[myusername@myhost myappc]$ git reset --hard origin/dev
HEAD is now at 2be5b0e Merged in mybranch (pull request #57)
I would have thought that doing a git reset --hard origin/dev would reset the repo to the last commit (which is pull request #81)?
I also have deleted all the files and folder (including .git*) from the filesystem and recloned the repo last week. It was behaving properly for awhile and this happened again.
