How do i go back to my last git commit

how do I go back to my last commit as I did a wrong merge but haven’t committed anything after the successful commit at the end of my last module (module 1)?

After finishing module 1 of QMoney I committed my files and got a successful build.
I pulled the files for module 2 and that showed merge conflicts.
Through some oversights, I ended up accepting the incoming changes without keeping my old functions.
Now I just want to go back to the point of the end of module 1 and start over with module 2, please help with what git commands or actions I need to take.

.

Don’t hard reset it. If you want to go back to your previous commit. Just use git commit <commit_id>.

If you don’t know how to get commit id, you can see this -

I want to go back to the last commit and also have only those files, i.e. delete the files that have been added and revert the files that were htere previously to their old state.

(i think git reset will solve half my problem, please advise on how to get files in old state as well)

use git rollback and it will give move you to the previous commits