I have mistakenly committed code and pushed it to master from GIT Bash, instead of doing commit new code to new branches, then merge to the master branch.
How can I undo my commit to the master branch. I have the HEAD at 40b66b17
Tried below options:
<MY_ID>@<Machine> MINGW32 /c (master)
$ git reset --hard 40b66b17
HEAD is now at 40b66b1 Add Components draft
<MY_ID>@<Machine> MINGW32 /c (master)
$ git push -f origin master
Everything up-to-date
<MY_ID>@<Machine> MINGW32 /c (master)
$ git show ORIG_HEAD
commit 40b66b17540f0ac5aa6ec83b8c843b7e9674e063
Author: My Name <My Email Id>
Date: Wed Feb 17 11:14:17 2016 -0600
Add Components draft
diff --git a/File1 b/File2
new file mode 100644
Still when I see the current HEAD pointer, it is showing at the same place. I want to have my master clean without any commits. My apologies with terminology here. As I am new to GIT.