git - Cannot commit after reverting one file from previous commit -
what did:
- i had file wrongly deleted in previous commit. in "version control" -> "log" clicked "revert selected changes" on file in changelist on right.
- android studio showed "patch applied"
after nothing happened — didn't appear in changelist. how commit revert?
android studio's "revert" not equivalent git revert
. behaves svn revert
discarding changes before svn commit
, or git checkout -- filepath
discarding changes before git add
.
it seems android studio not have git revert
button. in command line instead. if previous commit touches few files, assuming commit a, git checkout a^ -- filepath
"revert" 1 file , add , commit.
Comments
Post a Comment