Denis Stephanov
Denis Stephanov

Reputation: 5291

Revert all commits in branch and make clean copy of master

I have my feature branch which is created from master branch. I did some changes which I want revert back. In short I want feature branch which will be looks like after creation. After that reverts, I need do some changes and push it on bitbucket with amend parameter to the commit which is on server exist.

Upvotes: 2

Views: 9755

Answers (2)

oginski
oginski

Reputation: 364

Try

git checkout .

or

git reset --hard <commit>

To remove untracked files:

git clean -f

Upvotes: 1

hspandher
hspandher

Reputation: 16763

Just create a new branch from the master.

If you really want to revert for some reason, then you can use

git reset --hard <commit_you_want_to_go_back_to>

Upvotes: 0

Related Questions