It can be done multiple ways, continuing to edit this answer for spreading better knowledge perspective.
1) Reset hard
If you are working from remote develop branch, you can reset HEAD to the last commit on remote branch as below:
git reset --hard origin/develop
2) Delete current branch, and checkout again from the remote repository
Considering, you are working on develop branch in local repo, that syncs with remote/develop branch, you can do as below:
git branch -D develop
git checkout -b develop origin/develop
3) Abort Merge
If you are in-between a bad merge (mistakenly done with wrong branch), and wanted to avoid the merge to go back to the branch latest as below:
git merge --abort
4) Abort Rebase
If you are in-between a bad rebase, you can abort the rebase request as below:
git rebase --abort