Yesterday, I was working on my next patch i.e. Patch Number 3. While doing that, I came across a very unusual thing with my system that it was showing me indentation error. I made it correctly indented in terminal but it still shows indentation error. When i opened it with gedit it was again not properly indented. So after searching a lot, I came to know about a cool feature that is autopep8. It automatically indents your code.
$ pip install --upgrade autopep8
It will auto-format the code not only indentation but also spacing styles. So it makes the python script to conform PEP8 style guide.
$ autopep8 your_code.py
# to auto-format your code
$ git reset --hard HEAD~1
The HEAD~1 means the commit before head.
If you want to move you head to some earlier commit,then
$ git log
This will list all the commits made by you along with their commit id. You can find the commit-id of the commit you want to move your head to
$ git reset --hard <sha1-commit-id>
If you want to delete the commit that you have already pushed, then:
$ git push origin HEAD --force
set listchars=tab:→\ ,trail:·