- Run
git reflogand find first line from the top withoutrebase: - Take that line number, for instance:
HEAD@{5} - Run
git reset --hard HEAD@{5}to revert to the original state
git reset --hard HEAD~1
git reset --soft HEAD~1
git rebase --onto commitId^ commitId
git push -f
- Stage all your files you need to stash
- Run
git stash --keep-index. This command will create a stash with ALL of your changes (staged and unstaged), but will leave the staged changes in your working directory (still in state staged). - Run
git stash save "good stash" - Now your
"good stash"has ONLY staged files - Now if you need unstaged files before stash, simply apply first stash (the one created with
--keep-index) and now you can remove files you stashed to"good stash"
git stash push -m Message /path/to/file.ext
git config --global core.commentChar ";"
[user]
name = User Name
email = [email protected]
[winUpdater]
recentlySeenVersion = 2.24.0.windows.2
[fetch]
prune = true
[gui]
recentrepo = C:/Users/name/source/repos/GitTest
[core]
autocrlf = true
commentChar = ";"
[alias]
co = checkout
rod = rebase origin/development