Complete the command to view the reflog and find the commit before the hard reset.
git [1]The git reflog command shows a log of all recent HEAD changes, including before a hard reset.
Complete the command to reset the branch to the commit before the hard reset using its hash.
git reset --hard [1]You must specify the exact commit hash from reflog to reset back to that commit.
Fix the error in this command that tries to recover the commit before the hard reset.
git reset --hard [1]HEAD@{1} refers to the previous position of HEAD in reflog, useful after a hard reset.
Fill both blanks to create a command that shows the commit message and hash from reflog for the last 3 entries.
git reflog --pretty=format:'%[1] %[2]' -n 3
%h shows abbreviated commit hash, %s shows commit message subject.
Fill all three blanks to create a command that recovers the last hard reset commit and forces push to remote.
git reset --hard [1] && git push [2] [3] --force
This command resets to the previous HEAD position, then force pushes to the main branch on origin remote.