Sunday 11 March 2018

git - revert commits

just before push, if we have identified if there any files which has been committed and not yet pushed, we can revert that commit using below commit:


git reset HEAD~1


can run this command multiple times, if there are multiple commits. Once we push the code we can run this code.

This command just reverts the commits, doesn't change the files.