How to restore an old version of my code

Hi guys how are you ?

Just a question, while trying to implement firebase cloud messaging on my app ( what I, btw, didn’t achieve ), I did something wrong, don’t really know what, and now I can’t compile my app anymore to ‘serve’ it.
Then I wanted to know if I could go back to my last commit, but I mean restore my entire code to what it previously was ?
If I’m not clear just tell me.

Thanks for your help !

maybe you can’t restore not sure

seriously ?
So what is a git for then ?

If you havent commited yet
git reset --hard
Then remove all git ignored folders and try again.

If you want to go to an explicit version use git checkout

If you want to revert one special commit, use git revert

Maybe this helps: https://code.likeagirl.io/how-to-undo-the-last-commit-393e7db2840b