I accidentally use git add .
to add files to staging area and did a git push
which got rejected because I have a large file. I want to undo git add .
to unstage the files added. After some search I found git reset
to reset the staged files. I also go to my work directory and delete that large file. This time I tried git add ./myfolder/myfile.py
but still got rejected by remote saying that contains large files. remote: error: File myfolder/myfile.parquet is 374.75 MB; this exceeds GitHub's file size limit of 100.00 MB
. This file was git add
in the first time. It seems that git reset
does not work. How to do this properly?
Asked
Active
Viewed 49 times
0

newleaf
- 2,257
- 8
- 32
- 52
-
What does git status tell you? – matt Jan 23 '20 at 07:20
-
Did you commit before attempting to push? – GoodDeeds Jan 23 '20 at 10:59
-
I did commit before attempting to push. – newleaf Jan 23 '20 at 15:02
-
after ```git reset```, ```git status``` result like this ```On branch mychangebranch nothing to commit, working tree clean``` – newleaf Jan 23 '20 at 15:03
-
That is becuase you commited. So you are not trying to remove staged files. It goes stage -> commit -> push. So you need to undo a commit. – matt Jan 23 '20 at 15:40
-
Does this answer your question? [How do I undo the most recent local commits in Git?](https://stackoverflow.com/questions/927358/how-do-i-undo-the-most-recent-local-commits-in-git) – matt Jan 23 '20 at 15:41
-
I should undo commit. Thanks for @GoodDeeds Found this link https://stackoverflow.com/questions/927358/how-do-i-undo-the-most-recent-local-commits-in-git – newleaf Jan 23 '20 at 16:11