How to get back to a git branch after a git revert -



How to get back to a git branch after a git revert -

so, ended having alter whole directory tree of project because of fundamental problem code - or thought. made commit before big changes, realized after making changes did not need to. performed

git checkout ##sha##

i able create whole project working way should, have different problem. no longer checked-out in branch working in. how maintain code have , working within branch?

git branch -a

says in

* (no branch)

anyone know can without making new branch , deleting old one?

never git checkout <hash>. meant temporarily examine commit (and hence no branch see). wanted was, while in branch, git reset --hard <hash> ( remove --hard if have changes need in working directory.)

to recover:

git checkout the_branch git reset --hard <hash>

note <hash> above going same 1 used git checkout while trying "revert" changes.

git

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -